Discussion Board for collaboration related to QlikView App Development.
Hi Friends,
I am facing a issue to populate the current month sales vs previous year same month sales in pivot table.
I have columns like Year, Month and Sales. and created a pivot table.
if i select any year and month in the list box it should show selected year and month sales and previous year same month sales into the table.
i can populate the current year sales using Sum(Sales) but i am not able to populate the Previous sales.
please help to find the privies sales expression.
below is the out put table if i select the
Year = 2017,2016,2015,2014,2013 and Month = July.
Year | Month | Current year sales | Previous sales |
---|---|---|---|
2017 | July | 5000 | 6000 |
2016 | July | 6000 | 4500 |
2015 | July | 4500 | 7600 |
2014 | July | 7600 | 3400 |
2013 | July | 3400 | 2000 |
Dimension
Year
Month
Expression
SUM(Sales)
&
Below(Total SUM({<Year, Month>}Sales)) * Avg(1)
Or you can also look into
Hi Manish thanks for your reply.
Below(Total SUM({<Year, Month>}Sales)) * Avg(1)
I tried with your expression it is giving current year previous month total.
but my requirement is i need to show privies year same month total(July-2016)
if i select July 2017 in my list box, current sales should be sum of sales July-2017 and previous sales should be sum of July -2016
Try this
Below(Total SUM({<Year, Month>}Sales), 12) * Avg(1)
What chart/object you are using?
what are the dimensions in that object?
i am using pivot table and my Dimensions is
Year and Month
Hi Sunny your expression is working fine when there is no year selections, if i select any year it is showing 0 values.
Really? We are ignoring selection in Year field.... can you share a sample where we can see the issue?