Skip to main content
Woohoo! Qlik Community has won “Best in Class Community” in the 2024 Khoros Kudos awards!
Announcements
Nov. 20th, Qlik Insider - Lakehouses: Driving the Future of Data & AI - PICK A SESSION
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Ageing Category Expression Assistance

Hi, trying to do an IF statement as an expression to categorise invoices by age into ageing categories 1-30, 31 - 60 etc, the below is returning a result of all 120 + Days which I take it is because for categories 31 + I am just saying <61, <91 rather than >30 and < 61, >90 and < 121, but how would this be written to get the right result?

 

If (num(Today())-Num(InvoiceAge)<31,'1-30 Days',IF(num(Today())-Num(InvoiceAge)<61,'31-60 Days',IF(num(Today())-Num(InvoiceAge)<91,'61-90 Days',IF(num(Today())-Num(InvoiceAge

)<121,'90-120 Days','120 + Days'))))

Thanks

Roger

1 Solution

Accepted Solutions
Gysbert_Wassenaar

Today() returns a date. If InvoiceAge isn't a date but a number than subtracting it from today() would return a date. That numeric value of that date will almost certainly be larger than 120.

If InvoiceAge is a date you'll have to post a file with some data we can look at.


talk is cheap, supply exceeds demand

View solution in original post

1 Reply
Gysbert_Wassenaar

Today() returns a date. If InvoiceAge isn't a date but a number than subtracting it from today() would return a date. That numeric value of that date will almost certainly be larger than 120.

If InvoiceAge is a date you'll have to post a file with some data we can look at.


talk is cheap, supply exceeds demand