Wednesday, November 26, 2014

WHAT IF! ANALYSIS USING SET ANALYSIS in Qlikview


The below expressions were used in the chart against the dimension of
'Products' to show the difference between year 1997 and 1996 using a
slider object(scrollbar) with a variable
'Quantity' 'vQty' and for 'Unit Price' 'vPrice'


sum({$<Year={"1997"}>}Quantity)

= >gives the values of 'Quantity' field for the year of 1996

sum({$<Year={"1997"}>}Quantity) *vQty

= >gives the values of 'Quantity'  field multiplied by the value selected in
the scrollbar where 'vQty' is the variable used for the scrollbar

(sum({$<Year={"1997"}>}Quantity) *vQty)+(sum({$<Year={"1996"}>}Quantity))

gives the value + increased value ie the value after the increment/decrement

=((sum({$<Year={"1997"}>}Quantity)
*vQty)+(sum({$<Year={"1997"}>}Quantity)))-(sum({$<Year={"1996"}>}Quantity))



gives the value of 1997 Quantity  -  the value of 1997 Quantity after the
increment/decrement made in the scrollbar to show the difference in the
Quantity sales of the year 1997

similarly

=((sum({$<Year={"1997"}>}Quantity)
*vQty)+(sum({$<Year={"1997"}>}Quantity)))*((sum({$<Year={"1997"}>}UnitPrice)
*vPrice)+(sum({$<Year={"1997"}>}UnitPrice)))-((sum({$<Year={"1996"}>}Quantity))
* (sum({$<Year={"1996"}>}UnitPrice)))


gives the effect on both Quantity and Unit price which gives us the sales
value comparison on increasin year 1997's value
(sales =Quantity*Unit price)


No comments:

Post a Comment