Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello sir, i am new to qlik view,
I have 4 years sales data(2008,2009,2010,2011). i need to find out %change of sales from 2009, 2010,2011. Assume that i have fields "paymentYear", "salesAmount". i need 3 columns or rows containing year, salesamount, %change from YearToYear.
Please help me.
see the attached file
ex: for year 2009
% change= (2009 sales- 2008 sales/2008 sales)*100
Hi,
You can use below expression for all the three columns.
CY = SUM({$<paymentYear={"$(=Max(paymentYear))"}>} salesAmount)
PY = SUM({$<paymentYear={"$(=Max(paymentYear)-1)"}>} salesAmount)
%Change = (CY-PY)/PY
CY=Current Year, PY=Previous Year
Hope this helps.
Please revert back for any further query.
Cheers,
Dhananjay (DJ)
see the attached file
ex: for year 2009
% change= (2009 sales- 2008 sales/2008 sales)*100
Thank you sir it is working Fine.............
But,
I want to Use in single row. How can I apply this formula" =((column(1)-above(column(1)))/above(column(1)))" Because i am using pivot table. when i chaged to row-wise. it is not calculating.
Hi balaprasad,
Load data some thing like below
xxx:
Load * inline [
year,sales
2008,10
2009,20
2010,30
2011,40
];
Data:
load
*,
(sales-Previous(sales))/Previous(sales) as Value
resident xxx;
Drop table xxx;
And use Year as expression Value and Sales as expressions
See the attached sample file and Solutions sheet.
HTH
Rgds
Anand
I need OutPut Like
2008 %change 2009 %change 2010 %change
sales 30000 --- 40000 15% 50000 12%
Regards
Bala prasad