Discussion Board for collaboration on QlikView Layout & Visualizations.
I have the following table.
I need the value in the Outcome column when four different measures each have a certain value.
are all variables which hold individiual value (e.g. if Sales is Red, vOrders is Green etc).
So based on the value of the individual variables I need the overall colour to to be what is described in the Outcome column.
If vSales is Yellow and vMargin is Yellow, and vOrders is Yellow, and vDiscounts is Red, then the Outcome is Red.
and continue as per below spec....
Does anyone know an expression that can create this please?
It seems super complex so not sure how to do it!
How is the value assigned to the individual variable? Can you share the expressions behind those variables?
It would be along the lines of:
If(Sum(LineSalesAmount)>0.10, 'Green', If(Sum(LineSalesAmount)>0.65, 'Yellow'))
And the other variables have minor variations of the same example above.
May be like this :
=if(vDiscounts = 'Red' or vSales ='Red' or vMargin = 'Red' or vOrders = 'Red', 'Red' ,
if(vDiscounts = 'Yellow' or vSales ='Yellow' or vMargin = 'Yellow' or vOrders = 'Yellow', 'Yellow' ,
The best logic you may have find to be the one below.
if(vSales = Green and vMargin = Green and vOrders = Green AND vDiscounts = Green,
if(vSales = Green and vMargin = Green and vOrders = Green AND vDiscounts = Yellow,
if(vSales = Yellow and vMargin = Yellow and vOrders = Yellow AND vDiscounts <> Red,
Yellow, Green, Yellow, Green will be red
Instead of assigning them color, assign them values of 1, 2, 3, 4
If(Sum(LineSalesAmount)>0.10, 3, If(Sum(LineSalesAmount)>0.65, 2, 1)),
'Red', 'Yellow', 'Green')