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

Announcements
See why IDC MarketScape names Qlik a 2025 Leader! Read more
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Calculated Dimension

I have a field that has the number of days since a user registered.  I want to do a calculated dimension so at the top of my pivot table I can do 30, 60, 90.  From my reading it sounds like I can't use sum so I tried aggr but its not working. 

This is what I have http://screencast.com/t/ibML2JTgzPU

1 Solution

Accepted Solutions
Oleg_Troyansky
Partner Ambassador/MVP
Partner Ambassador/MVP

You used an incorrect syntax for AGGR (look it up in the manual), but this is not your probelm, You don't need any aggregation here. All you need is to divide all the data into 3-day buckets based on the number of days since registration. This is not an aggregation function.

Here is what I'd recommend:

ceil(Number_of_days/30) * 30

Divide the number of days by 30, then round up the result using ceil() and then multiply by 30 again.

Try it this way, it should work.

cheers,

Oleg

View solution in original post

3 Replies
Not applicable
Author

Interesting it is calculating now but not giving me the 30 60 90 day buckets.  http://screencast.com/t/dkyObzLGH6

Any ideas on how to do the buckets? 

Oleg_Troyansky
Partner Ambassador/MVP
Partner Ambassador/MVP

You used an incorrect syntax for AGGR (look it up in the manual), but this is not your probelm, You don't need any aggregation here. All you need is to divide all the data into 3-day buckets based on the number of days since registration. This is not an aggregation function.

Here is what I'd recommend:

ceil(Number_of_days/30) * 30

Divide the number of days by 30, then round up the result using ceil() and then multiply by 30 again.

Try it this way, it should work.

cheers,

Oleg

Not applicable
Author

Genius.  That worked perfectly.