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

Calculated Dimension not working

Hi All,

I have a put in a calculated, to work out buckets, need to be dynamic so no script change. The expression is:

=IF(Round(SUM(ChangeIncShareUSD),0.11) >= 500000, '>500k',

  IF(Round(SUM(ChangeIncShareUSD),0.11) >= 250000, '>250k to 500k',

  IF(Round(SUM(ChangeIncShareUSD),0.11) >= 100000, '>100k to 250k',

  IF(Round(SUM(ChangeIncShareUSD),0.11) >= 0, '>0k to 100k',))))

Worryingly it doesn't parse, but when placed as a normal expression it returns correctly just not grouping up.

Any help appreciated.

1 Solution

Accepted Solutions
sunny_talwar

You need the Aggr() function for the expression

=Aggr(

  IF(Round(SUM(ChangeIncShareUSD),0.11) >= 500000, '>500k',

  IF(Round(SUM(ChangeIncShareUSD),0.11) >= 250000, '>250k to 500k',

  IF(Round(SUM(ChangeIncShareUSD),0.11) >= 100000, '>100k to 250k',

  IF(Round(SUM(ChangeIncShareUSD),0.11) >= 0, '>0k to 100k',))))

, Dimension/s)

Dimension/s would be the dimensions on which you are aggregating your ChangeIncShareUSD

View solution in original post

4 Replies
Not applicable
Author

oops missed out the most important word 'dimension' as in calculate dimension.

sunny_talwar

You need the Aggr() function for the expression

=Aggr(

  IF(Round(SUM(ChangeIncShareUSD),0.11) >= 500000, '>500k',

  IF(Round(SUM(ChangeIncShareUSD),0.11) >= 250000, '>250k to 500k',

  IF(Round(SUM(ChangeIncShareUSD),0.11) >= 100000, '>100k to 250k',

  IF(Round(SUM(ChangeIncShareUSD),0.11) >= 0, '>0k to 100k',))))

, Dimension/s)

Dimension/s would be the dimensions on which you are aggregating your ChangeIncShareUSD

Anil_Babu_Samineni

May be one extra comma is there?

=IF(Round(SUM(ChangeIncShareUSD),0.11) >= 500000, '>500k',

  IF(Round(SUM(ChangeIncShareUSD),0.11) >= 250000, '>250k to 500k',

  IF(Round(SUM(ChangeIncShareUSD),0.11) >= 100000, '>100k to 250k',

  IF(Round(SUM(ChangeIncShareUSD),0.11) >= 0, '>0k to 100k',))))

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
Not applicable
Author

Thanks it is now working, just putting an Inline table to order the buckets. Thank you again.