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: 
Not applicable

RangeMax in set analysis

Hi All

I need to sum amount paid where the payment date minus the highest date of three dates is less than 31.

I have an if statement which works to show me if an invoice has been paid within 30 days:

=if(APCheck.PaymentDate-RangeMax(APInv.InvoiceDate,Alt(APInv.InvoiceReceivedDate,0),Alt(APInv.GoodsReceivedDate,0))<31,'0-30 Days','31+ Days')

But I need to now try and sum invoice amount where the above is <31. Something like this:

=sum({<APCheck.PaymentDate - RangeMax(APInv.InvoiceDate,Alt(APInv.InvoiceReceivedDate,0),Alt(APInv.GoodsReceivedDate,0))<31 }>}[APInv.AmountPaid])

but it won't calculate. I think it's telling me either I can't use RangMax in set analysis or that I can't write set analysis very well

Any ideas?

Thanks in advance

Labels (1)
1 Solution

Accepted Solutions
sunny_talwar
MVP
MVP

Can you try this:

Sum(If(APCheck.PaymentDate-RangeMax(APInv.InvoiceDate, Alt(APInv.InvoiceReceivedDate,0), Alt(APInv.GoodsReceivedDate,0)) < 31, [APInv.AmountPaid]))

UPDATE: Missed a parenthesis at the end earlier.

View solution in original post

3 Replies
sunny_talwar
MVP
MVP

Can you try this:

Sum(If(APCheck.PaymentDate-RangeMax(APInv.InvoiceDate, Alt(APInv.InvoiceReceivedDate,0), Alt(APInv.GoodsReceivedDate,0)) < 31, [APInv.AmountPaid]))

UPDATE: Missed a parenthesis at the end earlier.

Anil_Babu_Samineni
MVP
MVP

You can use RangeMax in Set Analysis, Would you provide application to work around

OR Try this, Can you elaborate more what was the 31

=sum(If(APCheck.PaymentDate - RangeMax(APInv.InvoiceDate,Alt(APInv.InvoiceReceivedDate,0),Alt(APInv.GoodsReceivedDate,0))<31, [APInv.AmountPaid])

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
Not applicable
Author

Thank you Sunny, this works