Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
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
| Company | Actual 2020 | Actual 2021 | Label |
Cpy A | 5000 | 10000 | HIGHER |
| Cpy B | 2000 | 1000 | LOWER |
| Cpy C | 3000 | LOSS | |
| Cpy D | 2500 | NEW |
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')
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')
Tnx, it works!