19 Replies Latest reply: Dec 27, 2017 7:36 AM by Sunny Talwar

# set analsis with variable

I download the expression set from a file, I have a problem with some expression when I use the variable always the result zero if I put the expression the result is correct

• ###### Re: set analsis with variable

try adding an equal sign "="

\$(=variable)

• ###### Re: set analsis with variable

even with =

• ###### Re: set analsis with variable

Try adding an extra = in variable or us an extra = inside dollar expansion

The Little Equals Sign

• ###### Re: set analsis with variable

even with =

• ###### Re: set analsis with variable

Are you just using your variable like this

vVar? Try adding a dollar sign expansion and see if that works

\$(vVar)

• ###### Re: set analsis with variable

Can you expand the width of the two columns and see if you see any difference in the expressions. You can do this at your end to see what is different between the two... if possible post a screenshot here

• ###### Re: set analsis with variable

Here is your difference... 2017 is missing

• ###### Re: set analsis with variable

\$(=Max(Left(DATE_SITUATION, 4)))

Try this

Max(TOTAL Left(DATE_SITUATION, 4))

• ###### Re: set analsis with variable

Like I mentioned, remove the dollar sign expansion and try to use Max(TOTAL....) and see if that works for you

• ###### Re: set analsis with variable

ok sunny i will tried

• ###### Re: set analsis with variable

SUM({<DATE_SITUATION,DATE_SITUATION={"=LEFT(DATE_SITUATION,4)=(Max(TOTAL Left(DATE_SITUATION, 4)))"},CLIENT_PRE_SEGMENT_A={"HAUT DE GAMME"}>}PROJET_AVENIR_VENTE_SITUATION)

like this?

• ###### Re: set analsis with variable

Looks right...

• ###### Re: set analsis with variable

Can you share the variable definition you are working with?

• ###### Re: set analsis with variable

Indicateur:

Indicateurs AS Indicateurs_Desc

FROM

[..\REF_IND\Spécification Base de données Pilotage Opérationnel.xlsx]

(ooxml, embedded labels, header is 1 lines, table is [Référentiel Indicateur]);

//LIST EXPRESSION

Expression_list:

Référence as Référence_Ind,

Indicateurs,

replace(Indicateurs,' ','') & replace(REF_Expression,' ','')  as desc_expression,

Segment,

Expression

FROM

[..\REF_IND\Spécification Base de données Pilotage Opérationnel.xlsx]

(ooxml, embedded labels, table is REF_Expression);

LET myCount = peek('REF_Exp',-1,[Expression_list]);

FOR _i = 0 to \$(myCount);

LET _varName = Peek('desc_expression',\$(_i),[Expression_list]);

LET _varValue = Peek('Expression',\$(_i),[Expression_list]);

//Now create the variables

SET [\$(_varName)] = \$(_varValue);

NEXT _i;

//LIST_ENTITY: