Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
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

1 Solution

Accepted Solutions
sunny_talwar

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

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

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