Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi Experts,
I would like to get LE Budget qty in expression with selected year month dynamically. Please advise.
eg. Choose 201909 Year month selection, then
sum({YearMonth>= selected year month, YearMonth<=select year's december}qty)
May be
sum({<YearMonth={">=$(=Max(YearMonth))<=$(=Max({1}YearMonth))"}>} qty)
I'm assuming that YearMonth is just an integer and not a Dual() containing a numeric date value. Then you can try this expression:
sum({<YearMonth={">=$(=Max(YearMonth))<=$(=left(Max(YearMonth),4)&12)"}>} qty)
-Vegar
@Anil_Babu_Samineni Your solution will work as long you are making selectio within the current year. When selecting a YearMonth from previous years will include all periods until December current year.
See attached QVF for a working example using the following script.
LOAD * INLINE [
YearMonth, qty
201801, 201
201802, 202
201803, 203
201804, 204
201805, 205
201806, 206
201807, 207
201808, 208
201809, 209
201810, 210
201811, 211
201812, 212
201901, 101
201902, 102
201903, 103
201904, 104
201905, 105
201906, 106
201907, 107
201908, 108
201909, 109
201910, 110
201911, 111
201912, 112
];
Create a variable on front end
vCurrentYearDec= left(max(YearMonth),4)&12
Then create expression
Sum({<YearMonth ={">=$(=max(YearMonth))<=$(vCurrentYearDec)"}>}Qty)