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

Announcements
Want to see what's currently in public preview? We've pulled it all together in one place. Check it out here
cancel
Showing results for 
Search instead for 
Did you mean: 
johndemars
Contributor II
Contributor II

Invalid dimension master item

Hello,

I have created 2 measures as master item in Qlik Sense, Actual 2020 and Actual 2021. In a table per company i want a label (higher, lower, loss, new) so i created a dimension. But when i put this dimension in a table then i get the message 'invalid dimension'. Can somebody help me?

Actual 2020: sum(if(Year=2020,Revenu))

Actual 2021:sum(if(Year=2021,Revenu))

Label: if(sum(if(Year=2021,Revenu))>sum(if(Year=2020,Revenu)),'HIGHER','LOWER')

For example

CompanyActual 2020Actual 2021Label

Cpy A

500010000HIGHER
Cpy B20001000LOWER
Cpy C3000 LOSS
Cpy D 2500NEW

 

Labels (3)
1 Solution

Accepted Solutions
Or
MVP
MVP

This needs to be a measure, not a dimension. If you want it to be a dimension for some reason, you'll have to use an aggr statement, e.g.

if(aggr(sum(if(Year=2021,Revenu))-sum(if(Year=2020,Revenu)),Company)>0,'HIGHER','LOWER')

View solution in original post

2 Replies
Or
MVP
MVP

This needs to be a measure, not a dimension. If you want it to be a dimension for some reason, you'll have to use an aggr statement, e.g.

if(aggr(sum(if(Year=2021,Revenu))-sum(if(Year=2020,Revenu)),Company)>0,'HIGHER','LOWER')

johndemars
Contributor II
Contributor II
Author

Tnx,  it works!