Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
risabhroy_03
Partner - Creator II

Subtracting from a variable in Set Analysis

I have the below expression - 

Sum({<[TRDT_Month_Flag_3]={1},Year_TRDT={($(vFiscalYear))-1}>}[Quantity in Inv Unit])

$(vFiscalYear) stores a value of 2022, but now I want to subtract -1 from it to make 2021.

Please help me.

1 Reply
sidhiq91
Specialist II

@risabhroy_03  Just one suggestion instead of substracting -1 in the Set Analysis.

Create a separate Variable First like Below:

Let VFiscalPreYear=Year(Addyears(today(),-1))

And then you can use it in the set Analysis

Sum({<[TRDT_Month_Flag_3]={1},Year_TRDT={($(VFiscalPreYear))}>}[Quantity in Inv Unit])

If this resolves your issue, please like and accept it as a solution.