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: 
ali_hijazi
Partner - Master II
Partner - Master II

is this doable?

Hello

I got a pivot table with several expressions ; actually 6 expressions

I want to group expressions under a label for example This Year, Last Year ; each 3 expressions under one label

can this be done?

Please advise

I can walk on water when it freezes
5 Replies
Gysbert_Wassenaar

Yes. Create a 'fake' dimension for the values 'This Year' and 'Last Year' either with the valuelist function or in an inline table in the script. Then create three expressions that check the value of the fake dimension and then calculate one of two of the original six expressions: if(valuelist('This Year','Last Year')='This Year', expression1, expression4)


talk is cheap, supply exceeds demand
Not applicable

Hi Gysbert,

In fact I was going to propose something like that but something stopped me because I didn't understood correctly the question.

Your solution is OK, but let's imagine that the OP wanted (for exemple) 2 expression under THIS YEAR, and 4 under LAST YEAR.

Do you have a way to do that, without having 4 under each label (including 2 blank under THIS YEAR) ??

I didn't manage to do it, but I am interested in the matter.

ali_hijazi
Partner - Master II
Partner - Master II
Author

ok fine but what I want is something like this

if (ValueList('X','Y')='X', expression1) and labeled 'Label 1' for example

now under the fake dimension value 'Y' I get an empty column labeled 'Label 1' and all cells are empty

how can I remove empty cells?

I can walk on water when it freezes
ali_hijazi
Partner - Master II
Partner - Master II
Author

did you manage to not display the empty cells

I can walk on water when it freezes
Not applicable

Yes that was also my question

Gysbert's solution is suitable only if you have the same columns under each label.

I don't know how to do it if they are different...