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

Using a variable in expressions

Hi,

 

I'm using a variable to calculate deppending on a field selected, this variable is named "Categoria".

I selected category "754" but using this function did not work.

Sum({<[SalesId]={"PV0***"},Catlevel2={$Categoria},CalendarYear_C = {"$(=max(CalendarYear_C)-1)"}>} Import_Brut)

But If I put instead of Categoria the value 754, the calculation is correct.

Sum({<[SalesId]={"PV0***"},Catlevel2={"754"},CalendarYear_C = {"$(=max(CalendarYear_C)-1)"}>} Import_Brut)

Thank's for your help

 

Eduard

1 Solution

Accepted Solutions
Mauritz_SA
Partner - Specialist
Partner - Specialist

Hi there

You have to dollar expand your variable using $(variable). It seems as if you are missing the brackets.

Sum({<[SalesId]={"PV0***"},Catlevel2={$(Categoria)},CalendarYear_C = {"$(=max(CalendarYear_C)-1)"}>} Import_Brut)

 Hope this helps.

Regards,

Mauritz

View solution in original post

2 Replies
Mauritz_SA
Partner - Specialist
Partner - Specialist

Hi there

You have to dollar expand your variable using $(variable). It seems as if you are missing the brackets.

Sum({<[SalesId]={"PV0***"},Catlevel2={$(Categoria)},CalendarYear_C = {"$(=max(CalendarYear_C)-1)"}>} Import_Brut)

 Hope this helps.

Regards,

Mauritz

ecabanas
Creator II
Creator II
Author

Thank's

@Mauritz_SA 

 

GREAT!!!