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
Put -1 after max month in your expression. You can use previous function as well.
As Ishtdeep already said:
Num(Sum({<Month={"$(=Max(Month)-1)"}>}Qty))
Let's do this:
Sum({<Month={">=$(=MonthStart(AddMonths(Month,-1)))<=$(=MonthEnd(AddMonths(Month,-1)))"}>}Qty)
Try this
F:
load *,Year(Date) as Year, Month(Date) as Month;
D:LOAD * INLINE [
Qty, Date
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
];
Previous Month Expression
=sum({<Year = {"=max(Year)"}, Month={"$(=month(MonthStart(max(Date))-1))"}>}Qty)
Hi Shivesh,
Can you please provide me in expression without editing the script.
Thanks,
Gowtham
This expression showing 0 values
i tried with but its not showing the result
Num(Sum({Month={"$(=Max(Month)-1)"}>}Qty))
Sum({Month={"$(=Max(Month),-1)"}>}Qty)
try this
I tried with same but still not result
Sum({Month={"$(=Max(Month),-1)"}>}Qty)
sorry i made small mistake
use this:
Sum({Month={"$(=Max(Month,-1))"}>}Qty)