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

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
dseelam
Creator II
Creator II

Bucketing and calculating

Hello Developers,

Hear is a interesting question I have count of ID for an interval bucket dimension which depends on num(dates ) in the script

In 30 day bucket I need the count of ID's in 30 days but not having the same ID in 60, 90 and 120

for example If have ID 12 in 30 day bucket it should not be counted in any other bucket 60, 90 and 120 buckets

same for 60 90 and 120

intervel.png

Thanks in advance

2 Replies
saurabh5
Creator II
Creator II

u can write a if condition:

if(isnull(date 1), null(),floor(date 1)-floor(date 2) as num_date,

then give a range:

if (isnull(num_date),null(), if (num_date<30,'0-30 days', if(num_date<61,'31-60 days',if (num_date<91,'61-90 days','91-120days'))))

try this if it works!!!

SergeyMak
Partner Ambassador
Partner Ambassador

You can use e() function, but it depends on your data model.

If you share a sample I cat try to help you with the correct expression

Regards,
Sergey