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

Announcements
Join us to spark ideas for how to put the latest capabilities into action. Register here!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Max of date

Lease IDSubIDSubspace Expiration DateExpIDAmountExpense TypeAmount* Frequencypay_frequency
2459.62 29515.44
4465105/9/201633381016.37Base Rent Post Free Rent12196.44Monthly
4466695/9/201748251016.37Base Rent Post Free Rent12196.44Monthly
4465105/9/20163340213.44Occupancy Tax / Sales Tax2561.28Monthly
4466695/9/20174827213.44Occupancy Tax / Sales Tax2561.28Monthly

       

=Sum(Aggr((Max([Amount of Expense]) * Pick(Match(pay_frequency, 'Monthly', 'Quarterly', 'Annually', 'Semi Annually','One Time'), 12, 4, 1, 2,1)),SubID,[Expense Type],ExpID))

For the above expression is working now iI have to add the if statement to pick only the max of date.So ex : it should pick the date 5/9/2017.

How can I add that If statement to the above expression.

Thank you very much.

12 Replies
sunny_talwar

What if you do this:

FirstSortedValue(Aggr((Max([Amount of Expense]) * Pick(Match(pay_frequency, 'Monthly', 'Quarterly', 'Annually', 'Semi Annually','One Time'), 12, 4, 1, 2,1)),SubID,[Expense Type],ExpID), -[Subsapce Expiration Date])

Not applicable
Author

Nope - It didnt work.It returned blank.

sunny_talwar

Do you have a sample you can share?

Not applicable
Author

sunindia Please find attAched Excel and QVW.Thank you very much.

sunny_talwar

Do you want to see it against all the dimensions?

Not applicable
Author

I want it againt Lease ID,Subspace ID,Expense ID

sunny_talwar

This?

Capture.PNG

Dimensions

1) =[Lease ID]

2) =[Subspace ID]

3) =Aggr(If(Max(TOTAL <[Subspace ID]> [Subspace Expiration Date]) = [Subspace Expiration Date], [Expense ID]), [Subspace Expiration Date], [Expense ID])

Expression

Sum(Aggr(Max([Amount]) * Pick(Match(pay_frequency, 'Monthly', 'Quarterly', 'Annually', 'Semi Annually','One Time'), 12, 4, 1, 2,1), [Subspace ID],[Expense Type],[Expense ID]))

Not applicable
Author

Ya,but what should I do If I have to add more dimensions ?Thank you

sunny_talwar

Which dimensions are you looking to add?