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: 
NikosSpanos
Contributor III
Contributor III

How to create two columns one next to the other in a pivot table

I am using Qlik Sense cloud service and I have created a pivot that looks like this:

Pivot tablePivot table

As you can see I have two columns named "Data at <Date1>", "Data at <Date2>".

<Date1> and <Date2> take their respective value from the two drop down-lists highlighted on the left side of the pivot table.  In case you wonder the drop-down lists are:

drop-down list variabledrop-down list variable

My question is how can I place the two columns next to each other instead of one below the other. My desired output I would like to be:

"Data at <Date1>"           | "Data at <Date2>"

Stage 1, Stage 2                |  Stage 1, Stage 2

Measure1, ....Measure4 | Measure1, ....Measure4

A relevant link I found is this one , however even if I tried to concatenate <Date1>, <Date2> and then apply this expression:

1) Left('Data at $(V_Start)' & ',Data at $(V_End)', index('Data at $(V_Start)' & ',Data at $(V_End)', ',',substringcount( 'Data at $(V_Start)' & ',Data at $(V_End)', ',')) - 1)

2) Mid('Data at $(V_Start)' & ',Data at $(V_End)', index('Data at $(V_Start)' & ',Data at $(V_End)', ',',substringcount( 'Data at $(V_Start)' & ',Data at $(V_End)', ',')) + 1)

, I only achieved the result in the screenshot attached.

 

Any suggestions would be much appreciated.

Labels (3)
5 Replies
Anil_Babu_Samineni

Since you are using both from single field, I will try with 2 variable a like

Contact(Var1 & ' | ' & Var2, ':')

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
NikosSpanos
Contributor III
Contributor III
Author

@Anil_Babu_Samineni  I get in return invalid dimension error

Invalid dimensionInvalid dimension

Anil_Babu_Samineni

I would do first as expression and check what it is returning? Also, Please share if something not working as expected, we will see in your data (Again, we won't ask your real time data but at least some scramble data)

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
NikosSpanos
Contributor III
Contributor III
Author

I have used the expression you proposed in the column section of a pivot table

The expression you proposed is this one: Contact($(Var1) & ' | ' & $(Var2), ':'),

Var1, Var2 are two dates for example '30/09/2020' and '31/12/2020'. This is random, they could be anything else. My point is how I can create two columns next to other using as column name the values of Var1, Var2. If I find sometime to upload some data I will let you know. Ty 🙂

 

Anil_Babu_Samineni

Sure, I will wait for your sample data

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