Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi All,
can you please help me to populate previous month values, for the below sample set of data
data set
Qty | Month |
1 | 01-01-2018 |
2 | 02-02-2018 |
3 | 03-03-2018 |
4 | 04-04-2018 |
5 | 05-05-2018 |
6 | 06-06-2018 |
7 | 07-07-2018 |
8 | 08-08-2018 |
9 | 09-09-2018 |
10 | 10-10-2018 |
11 | 11-11-2018 |
12 | 12-12-2018 |
Thanks,
Gowtham
Still not correct its showing -
I guess your month field is not in the date format. Make sure it's not a text field. Test this:
IsNum (Month)
If you get -1 as result, then your field is a numerical one. Otherwise, you must to format it into load script.
Cheers
yes its -1 how to change it now
try this
sum({<Month={"=max(Month)-1"}>}Qty)
try
a:
load *, month(MyDate) as NewMonth,
date(MyDate) as NewD,
Num(Month(MyDate)) as MonthNum;
LOAD Qty,
MyDate
FROM
(ooxml, embedded labels, table is Sheet3);
Frontend:
Strighttable
dim: Month
Exp: sum({<MonthNum={"=max(MonthNum)-1"}>}Qty)