Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Qlik Age analysis?

Dear All,

My sample pivot table is like below,

   

             Datedebit noteamount0-3031-6061-90over 90
1/01/2014BAD00011000
5/02/2014BAD00021500
8/03/2014BAD00032500
10/10/2014BAD00041250
12/11/2014BAD00052000

How I could write a formula to categorized the amount to the correct age group? I'm looking forward to have a sample formula(expression) for this.

Regards,

Priyantha.

6 Replies
Anonymous
Not applicable
Author

Hi,,

Create buckets using interval function:

If((interval(Date(Today(),'DD-MM-YYYY hh:mm:ss')-Date(Date/Time,'DD-MM-YYYY hh:mm:ss'),'dd'))<=30, '0-30',
If((interval(Date(Today(),'DD-MM-YYYY hh:mm:ss')-Date(Date/Time,'DD-MM-YYYY hh:mm:ss'),'dd'))<=60, '31-60',
If((interval(Date(Today(),'DD-MM-YYYY hh:mm:ss')-Date(Date/Time,'DD-MM-YYYY hh:mm:ss'),'dd'))<=90, '61-90','>90'))) as ByAge,

regards

Neetha

alkesh_sharma
Creator III
Creator III

Its better to create age buckets @ script level rather than UI

Script would be

LOAD ....

..

...

IF((Today() - <YourDate>)<0, Dual('Not Due',0),

     IF((Today() - <YourDate>)<=30, Dual('0-30',1),

          IF((Today() - <YourDate>)<=60, Dual('30-60',2),

               IF((Today() - <YourDate>)<=90, Dual('60-90',3), Dual('Over 90',4) AS AGE_Bucket

..

..

FROM

<Table Name>

Anonymous
Not applicable
Author

the above code is for script level

alkesh_sharma
Creator III
Creator III

Yes,

You can use the same script @ UI as well but it is generally not recommended as this would make your application slower as the data increases.

Anonymous
Not applicable
Author

Yes,it will make slow performance wise and maintenance wise.

if buckets created at script level,we can use them in all objects

depending on requirements.

Thanks

Neetha

alkesh_sharma
Creator III
Creator III

Please mark it correct if it solved ur purpose.

Thanx