Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi i am working on set analysis for lastyear mtd values
i am calculating with variables
below are my variable declaration
for
LastYearMonthStart (vMnthStartLY) : =Date(MonthStart(AddMonths(Max(CalDate),-12)),'DD/MM/YYYY')
LastYearMonthToDate (vLyMtd) :=Date(Max(CalDate)-364,'DD/MM/YYYY')
below is my set Expression
Sum({<CalDate={'>=$(vMnthStartLY) <=$(vLyMtd)'}>}LY_DAY_NET_SALES)
the above set expression is giving zero values between dates in the variable but when i hard code particular dates it is giving correct results .
but my variables used in the set expresiiion are also giving the correct dates .
please fnd the attachment
Any help is appreciated
Thanks
Try with double Quotes
Sum({<CalDate={">=$(vMnthStartLY) <=$(vLyMtd)"}>}LY_DAY_NET_SALES)
Do those variables contain the right-hand expression itself, or do they contain the result of the expression?
Create tow variables in Variable Overview as below
vMnthStartLY
Date(MonthStart(Max(CalDate),-12))
vMnthEndLY
Date(MonthEnd(Max(CalDate),-12))
Make sure that in Variable definition you should not use = in front of any Variable expression
Now use below expression
=SUM({<CalYear= , CalMonth = , CalDate = {">=$(=$(vMnthStartLY))<=$(=$(vMnthEndLY))"}>}LY_DAY_NET_SALES)
What about your CalDate format?
For testing, remove the label for set expression and check it is showing correct date value
variables contain result of the expression .
i have declared as below
vMnthStartLY =Date(MonthStart(AddMonths(Max(CalDate),-12)),'DD/MM/YYYY')
vLyMtd =Date(Max(CalDate)-364,'DD/MM/YYYY')
I have already tried avinash but no luck
In addition may be try removing the space between your first variable and less than equal sign (<=)
Sum({<CalDate={">=$(vMnthStartLY)<=$(vLyMtd)"}>} LY_DAY_NET_SALES)
Can you give an example of their current values? Does the formatting you are using in the Date() call match the default DateFormat setting?
Hi Settu
i have tested it is giving correct values