Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello all,
I'm want to show YTD Amount of previous Month
.
I hold 4 variables:
2 Variables for Previous Month
vMinSourceDate = date(MonthStart(addmonths(Min(date(TransDate)),-1)),'MM/DD/YYYY')
vMaxSourceDate = date(MonthEnd(addmonths(Min(date(TransDate)),-1)),'MM/DD/YYYY')
2 Variables for Current Month
vCurrentMonthStartDate= date(MonthStart(Min(date(TransDate))),'MM/DD/YYYY')
vCurrentMonthEndDate= date(MonthEnd(Min(date(TransDate))),'MM/DD/YYYY')
I created one Variable vTestAmt in which the addition Value of Current Month and Previous Month.
Variable Expression is :
vTestAmt = Sum({<Year=, Month=, TransDate = {">=$(=vMinSourceDate)<=$(=vMaxSourceDate)"}>}[YTD Amt])+(Sum({<Year=,Month=,TransDate = {">=$(=vCurrentMonthStartDate)<=$(=vCurrentMonthEndDate)"}>}MTD*Percent)/100)
And now I want to use above variable " vTestAmt " in Straight table expression for previous Month Value like:
Sum({<Year=, Month=, TransDate = {">=$(=vMinSourceDate)<=$(=vMaxSourceDate)"}>}$(vTestAmt))
and It doesn't work for me.I am want to add the previous Month value in the current Month Value so I need to find this value .
What am I doing wrong?
Please give me any Idea. Any help will be appreciated .
Thanks
Deepak.
Could you post your sample qvw?