Skip to main content
Announcements
Accelerate Your Success: Fuel your data and AI journey with the right services, delivered by our experts. Learn More
cancel
Showing results for 
Search instead for 
Did you mean: 
stone1974
Contributor
Contributor

Different behavior between variable editor and code editor

Hi!

I have formulars to get a selected data and then the month before.

SET vSelectedDate = Date(GetFieldSelections([FiscalPeriods.CalendarYear]) &'-'& GetFieldSelections([FiscalPeriods.CalendarMonth]) &'-1');

SET vSelectedMonth = "$(=Num(Month($(vSelectedDate))))";

SET vSelectedMonthMinus1 =  "$(=Num(Month(AddMonths($(vSelectedDate),-1))))";

SET vSelectedYear = "$(=Num(Year($(vSelectedDate))))";

SET vSelectedYearMinus1 = "$(=Num(Year(AddMonths($(vSelectedDate),-1))))"

SET vValue = (Sum({$ <PLI.TEST={"TEST"}, [FiscalPeriods.CalendarYear]={$(vSelectedYear)}, [FiscalPeriods.CalendarMonth]={$(vSelectedMonth)}>} PLI.Value))

The code is working fine if I put it in the variable editor but if I put it into the code editor its not working anymore. WHY? Any hints r welcome 😊.

Thank u very much!

2 Replies
Taoufiq_Zarra

 @stone1974  how do you use this variable in an editor ?

Regards,
Taoufiq ZARRA

"Please LIKE posts and "Accept as Solution" if the provided solution is helpful "

(you can mark up to 3 "solutions") 😉
stone1974
Contributor
Contributor
Author

Hi,
At the end, I just use the vValue as $(vValue).
Regards,
Michael