Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
GraceGao
Creator
Creator

Set analysis expression

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)

 

5 Replies
Anil_Babu_Samineni

May be

sum({<YearMonth={">=$(=Max(YearMonth))<=$(=Max({1}YearMonth))"}>} qty)

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
Vegar
MVP
MVP

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 

Vegar
MVP
MVP

@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. 

Vegar
MVP
MVP

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
];

  

Kushal_Chawda

Create a variable on front end

vCurrentYearDec= left(max(YearMonth),4)&12

Then create expression

Sum({<YearMonth ={">=$(=max(YearMonth))<=$(vCurrentYearDec)"}>}Qty)