Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi All,
I am trying to get the previous volume value of the selected week in a single row.
If I select '08/28/15' week, in the chart I should see the volume of '08/28/15' and volume of previous 4x4 week'07/31/15' in a single row.
Note: week values are '4x4' weeks i.e. variation between each value is 4 week.
Please find the attached qvw.
Thanks in advance,
Padmanabhan
Data:
LOAD
AutoNumber(Week) as WeekID,
*
INLINE
[
Week, Volume
09/26/14, 344
10/24/14, 546
11/21/14, 643
12/19/14, 876
01/16/15, 1234
02/13/15, 6754
03/13/15, 2345
04/10/15, 768
05/08/15, 879
06/05/15, 986
07/03/15, 111
07/31/15, 3278
08/28/15, 7689
];
Temp:
Mapping Load WeekID, Volume Resident Data;
Final:
Load *, ApplyMap('Temp',WeekID-1, 0) as PreviousWeekVolume Resident Data;
Drop Table Data;
Now use below expressions
sum(Volume)
SUM(PreviousWeekVolume)
Data:
LOAD
AutoNumber(Week) as WeekID,
*
INLINE
[
Week, Volume
09/26/14, 344
10/24/14, 546
11/21/14, 643
12/19/14, 876
01/16/15, 1234
02/13/15, 6754
03/13/15, 2345
04/10/15, 768
05/08/15, 879
06/05/15, 986
07/03/15, 111
07/31/15, 3278
08/28/15, 7689
];
Temp:
Mapping Load WeekID, Volume Resident Data;
Final:
Load *, ApplyMap('Temp',WeekID-1, 0) as PreviousWeekVolume Resident Data;
Drop Table Data;
Now use below expressions
sum(Volume)
SUM(PreviousWeekVolume)
Thanks for the response Manish.
But the Weeks are repeated they are not unique every time. Each week will have more than one entry, in that scenario there will be more than one WeekID will be created for a Week.
Thanks,
Padmanabhan
Provide data with repeat week. I will do it for you...!
Hi Manish,
Thank you, I did created a week field with distinct value and then used it to create auto number and it worked.
Thanks and regards,
Padmanabhan