I have personal Edition, so I cannot open your application. But :
1) Set Analysis : they are computed ONCE per chart, not once per row (here, if you want to use set analysis, you would need different results across the lines => it is not good)
2) You can use functions like above() that will return the N lines above. The problem is for the 1st line where it returns 0.
If the months are across (in column), you will use Before() function instead.
3) You can also modify the model so that you create intermediate tables (called AsofTable) to simplify YTD, Previous period etc.
See a doc I have written on that topic: http://community.qlik.com/docs/DOC-4821
It can be possible by above function. Please go through the attached QVW . Hope it solve your query.
Total Sales per Month.qvw 447.2 K
user this script:
Date(SalesDate,'MMM-YY') as SalesMonth,
Date(SalesDate,'YYYYMM') as MonthNo
(ooxml, embedded labels, table is Sheet1);
LOAD RowNo() as No,
Qty as CurrentMonthQty,
Value as CurrentMonthValue,
if(RowNo() =1 ,0 ,Previous(Qty)) as PreviousMonthQty,
if(RowNo()=1,0,Previous(Value)) as PreviousMonthValue
Resident SalesDataTemp order by MonthNo;
drop table SalesDataTemp;
I have done this . u can check the qvw file in which both current month and previous month wise sales is working .
If u select the year then it will show the current month and previous month sales of selected year according to the product code.
Total Sales per Month.qvw 449.8 K
The month_name would be work as dimention when u will use the bar chart. Bcz when u will pass the month_name as a dimension in pivot table then it will show only that month sales which is in dimension .
According to that month which is in dimension the sales would be appear if we will calculate the previous month then it will show the zero bcz it will not get the dimension.