Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi, I like to show an forecast. (simulation)
Here an example of my problem.
name, Date, value
TYP A, Nov15, 99
I have many of these types but I like to reduce the value each month of -1
Here the result:
Typ A, Dez 15, 98
Typ A, jan16, 97
Typ A, Feb16, 96 ....etc
any ideas?
MANY THANKS:)
Something along these lines should do the trick:
Let vMaxForecastDate = num(Makedate(2017,1,1));
LOAD *,
Date(addmonths(Date,iterno()-1),'MMMYY') as ForecastDate,
value-(iterno()-1) as ForecastValue
While addmonths(Date,iterno()-1) <= $(vMaxForecastDate);
LOAD name, Date#(Date,'MMMYY') as Date, value
INLINE [
name, Date, value
TYP A, Nov15, 99
TYP B, Jan16, 121
];
Something along these lines should do the trick:
Let vMaxForecastDate = num(Makedate(2017,1,1));
LOAD *,
Date(addmonths(Date,iterno()-1),'MMMYY') as ForecastDate,
value-(iterno()-1) as ForecastValue
While addmonths(Date,iterno()-1) <= $(vMaxForecastDate);
LOAD name, Date#(Date,'MMMYY') as Date, value
INLINE [
name, Date, value
TYP A, Nov15, 99
TYP B, Jan16, 121
];
YOU HELP ME A LOT:)
THANKS TO YOU