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

Announcements
Join us in NYC Sept 4th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Not getting proper bucket

Dear All,

I am not getting proper bucketing that is 'Above 181 ' is missing.

Thanks

7 Replies
tresesco
MVP
MVP

Try a simpler expression like:

LOAD

      if( today()-[Due Date]<=0, 'Not Due',

      If(today()-[Due Date]<=180, '1-180', 'Above 180')) as Bucket

Anonymous
Not applicable
Author

Hi Vijay,

Apply following in script

if( interval(date(Today(),'DD-MM-YYYY')- date#(date([Due Date],'DD-MM-YYYY'),'DD-MM-YYYY'))<=0 ,'Not Due',

if( interval(date(Today(),'DD-MM-YYYY')- date#(date([Due Date],'DD-MM-YYYY'),'DD-MM-YYYY'))<=180,'91-180',

if( interval(date(Today(),'DD-MM-YYYY')- date#(date([Due Date],'DD-MM-YYYY'),'DD-MM-YYYY'))>=181,'Above 181'))) AS Bucket

Please find attached QVW for detailed information.

Thanks,

Anonymous
Not applicable
Author

Hi Tresesco,

Very helpful.

Now I want like this..

BalanceNot Due1 - 30 days31 - 60 days61 - 90 daysMore than \90 days

Note: Balance is sum([Amount (LCY)])

Anonymous
Not applicable
Author

Hi,

it's better to calculate difference between dates separately in other filed and then use that date filed in if..condition to create buckets.

if you provide your..date fields...we will give you better solutions.

jonathandienst
Partner - Champion III
Partner - Champion III

Use this expression in the load - I have removed all the unnecessary formatting and flooring:

      If(Today() - Floor([Due Date]) <= 0 , 'Not Due',

      If(Today() - Floor([Due Date]) <= 90 , '0-90',

      If(Today() - Floor([Due Date]) <= 180, '91-180', 'Above 181'))) as Bucket,

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein
Anonymous
Not applicable
Author

Hi Jonathan,

I am looking for this..

BalanceNot Due1 - 30 days31 - 60 days61 - 90 daysMore than \90 days
Anonymous
Not applicable
Author

hi vijay.

your requirement is to create a..buckets with 1-30 and 31-60 and 61-90....

these all equal size of buckets..

you can also calculate..buckets with class function to get same size of buckets instead of using if condition.

through if condition we can calculate different sizes of buckets and as well as equal sizes of buckets

where is class function with simple code we can calculate equal size of buckets..