Forum

Filter rows based o...
 
Notifications
Clear all

Filter rows based on Max Date criteria

3 Posts
2 Users
0 Reactions
152 Views
(@alib40)
Posts: 113
Estimable Member
Topic starter
 

Hi

Help Please ….

I have a table of Quotes by Op_Id.   Each Op_Id can have multiple quotes.   I want to cleanse the data so that only the latest quote based on QUO_CreateDate for each Op_Id is returned to PowerPivot where IsClosed = False

 

Eg:  In this table 

RawDataImg1.PNG

only the lines for Quote 2 - Op1, Quote6 - Op4 and Quote 4 - Op3 would be returned to powerpivot  As below

CleansedDataImg1.PNG

I've attached the data

 
Posted : 15/07/2019 4:26 pm
(@mynda)
Posts: 4761
Member Admin
 

Hi Alison,

Your example data does not match what you're asking for.

e.g.

1. In the Excel file you say "if OP_IsClosed = TRUE then send to Power Pivot". Row 8 for Op2 matches this criteria, yet it is not in your "Example cleansed data sent to Power Pivot" table.

That said, you can duplicate the query and use GroupBy to create a list of the max dates and then merge the queries as new to just extract the line items that match the max date query. See attached.

If you want to filter out the TRUE Op_IsClosed items then you can easily do that too.

Mynda

 
Posted : 15/07/2019 7:41 pm
(@alib40)
Posts: 113
Estimable Member
Topic starter
 

Thank you

 
Posted : 20/07/2019 6:03 am
Share: