Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi Experts! I need your help to calculate difference or variation of two columns pivoting table only 1 dimension qlik sense.
I need to add another column with the official team variation and backup.
Dimension Row
Company
Column
equipment
Measure
Sum(Sales)
=Sum({<equipment={'officer'}>} sales)-Sum({<equipment={'backrest'}>} sales)
try this as ur variance
It has not worked for me is not calculating correctly the variation, in the green box the variation should be -3 of the backup
before(sum(Value))-sum(Value)
It worked for me changing before for after, but I need the variation to be added as a 3 column.
It has stayed like this but I do not want to show it like that.
try to make table instead of pivot or try ad them as columns
Hi guitartrova,
If you need to add a custom column to pivot table, you can do it by using "valuelist" function to add custom values.
Dimension Row : Company
Column : ValueList('officer','backrest','Var')
Measure :
pick(match(ValueList('officer','backrest','Var'),'officer','backrest','Var'),
sum({<equipment={'officer'}>}value),
sum({<equipment={'backrest'}>}value),
(sum({<equipment={'officer'}>}value)-sum({<equipment={'backrest'}>}value))
)
Output :
Hope it helps,
Hi, do you know how to set the Var background color in this case?
(if Var<0, red, green)