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

Announcements
Posting on Qlik Community is temporarily paused for some users. Thank you for patience and we'll update you soon!
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Create a Usage Slab

Hi Everyone,

I am calculating Usage% metric in my straight table. The calculation is Num(Sum(Nominal)/(Sum(Nominal)+Sum(Undrawn)),'0%').

This usage is being calculated across many dimensions.

Now I want to create a Usage Slab like:

'0%'

'1 – 50%',

'51 – 100%'

and based on a particular slab selection, the data should get filtered.

I tried this in my script using IF, but the problem here is that it is applying the calculation at row level where as my Usage% is an aggregated function calculated in the front end.

I am not sure how to resolve this issue. Any help is highly appreciated.

Thanks

Labels (1)
6 Replies
vinieme12
Champion III
Champion III

please post a sample app

Vineeth Pujari
If a post helps to resolve your issue, please accept it as a Solution.
Kushal_Chawda
MVP
MVP

You need to create the calculated dimension in straight table

Aggr(if(Sum(Nominal)/(Sum(Nominal)+Sum(Undrawn)) =0,dual('0%',1),

if(Sum(Nominal)/(Sum(Nominal)+Sum(Undrawn)) >0 and

Sum(Nominal)/(Sum(Nominal)+Sum(Undrawn))<=0.5,dual('1-50%',2),

if(Sum(Nominal)/(Sum(Nominal)+Sum(Undrawn)) >0.5 and

Sum(Nominal)/(Sum(Nominal)+Sum(Undrawn))<=1,dual('51-100%',3)))), dimension1,dimension2, dimension3)



where dimension1,dimension2, dimension3 are your actual straight table dimension, include all dimension of straight table in Aggr


Check Suppress when value is null option

Anonymous
Not applicable
Author

I think we cannot do aggr in calculated dimension

rwunderlich
MVP
MVP

On the contrary. In general, you should use Aggr() in Calculated Dimension.

-Rob

http://masterssummit.com

http://qlikviewcookbook.com

Kushal_Chawda
MVP
MVP

You can use Aggr in calculated dimension

vinieme12
Champion III
Champion III

infact you should always Aggr() on a calculcated dimension, especially when working with Pivots

Vineeth Pujari
If a post helps to resolve your issue, please accept it as a Solution.