Discussion Board for collaboration related to QlikView App Development.
I want a set analysis which calculate the growth in sales of current week when compared to the previous week. Also the set analysis should take when we are calculating the growth of first week sales of new year to the growth of last week sales of the previous year. Can you please provide some solution for this?
To deal with weeks running over years you need to create a field in the script to get a serial weeknumber that doesn't reset per year. Your data needs to be ordered by week (or date) and then you can use the autonumber function to create a new week field: autonumber(Week,'WeekSerial') as WeekSerial. Or if you have a date field autonumber(weekstart(date),'WeekSerial') as WeekSerial.
If you want to use the week as dimension in a chart then you can't use set analysis. The set is calculated per chart, not per row. In that case see this document: Calculating rolling n-period totals, averages or other aggregations
If your going to select a week in a listbox and want to see the current and previous sales growth you can use something like:
Gysbert's answer is complete.
However, if you want to calculate the growth in the chart across weeks, you have to modify your data model because the set analysis is calculated once, for the whole chart.
I had published a document several weeks ago:
It may be useful in that case.