Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Want to see what's currently in public preview? We've pulled it all together in one place. Check it out here
cancel
Showing results for 
Search instead for 
Did you mean: 
timothyj
Creator
Creator

Having Trouble Matching Dates

I have a product that changes price periodically. I need to be able to flag the latest price. I have the State, Area and Gender along with implementation date and price. I use a combination of State, Area, and Gender to get a Aggr Key and then use an Aggr function in a calculated dimension to get the Max Date. All this seems to work. All I have to do now is flag where the Imp Date matches the Max Date. I just cannot get this to work. I have tried as dates, numbers and text. I just cannot get dates to match. I have searched and Googled and spent many hours on this. I just cannot figure it out. Any ideas. Attached is a sample qvw.

Thanks.

Labels (1)
1 Solution

Accepted Solutions
swuehl
Champion III
Champion III

Try this as calculated Match dimension:

=Aggr(if(Max(Total<[AGGR KEY]> [Imp Date])=[Imp Date],1,0),[Imp Date], [AGGR KEY])

View solution in original post

2 Replies
swuehl
Champion III
Champion III

Try this as calculated Match dimension:

=Aggr(if(Max(Total<[AGGR KEY]> [Imp Date])=[Imp Date],1,0),[Imp Date], [AGGR KEY])

timothyj
Creator
Creator
Author

Wow, that works perfectly!

Why does it work?