Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Problems with set expression read from external file

Goodmorning everyone.

I plugged in an external file the Set expression to use in charts.

The format is in the qvs file:

SET @ORDCLI_Mese11_Y1_ValValuta = SUM( {<ANNO={$(Previous_Year)},AREA={"ORD"},MESE={$(Mese_MM_meno11)}>} VALORE_IN_VALUTA );

SET @ORDCLI_Mese11_Y1_Val€ = SUM( {<ANNO={$(Previous_Year)},AREA={"ORD"},MESE={$(Mese_MM_meno11)}>} VALORE );

ecc

ecc

In the load script I read the formulas:

$(Must_Include=$(_DIRINCLUDE)Expressions.qvs)

In view of the variable in the document the set expression they are set with the variables indicated by ($ (Previous_Year)) and $ (Mese_MM_meno11) already valued.


If these variables change in the document in the formulas are not changed. (by slider ot other object)

In view of variables it should be given the variable and not the value it contains.

To work should be seen in the variables:

SUM( {<ANNO={$(Previous_Year)},AREA={"ORD"},MESE={$(Mese_MM_meno11)}>} VALORE )


How should I write in the external file the Set expression?

I enclose File set expression.

Thank you all.

1 Solution

Accepted Solutions
sunny_talwar

I guess I see what is going on... Two ways

1) Rename the First variable to something else:

SET @ORDCLI_Mese11_Y1_Val€Temp =SUM( {<ANNO={#(Previous_Year)},AREA={"ORD"},MESE={#(Mese_MM_meno11)}>} VALORE );

SET @ORDCLI_Mese11_Y1_Val€=Replace(@ORDCLI_Mese11_Y1_Val€Temp,'#','$');

2) Use this other approach

LET @ORDCLI_Mese11_Y1_Val€ ='Sum({<ANNO={$' & '(Previous_Year)}, AREA={"ORD"},MESE={$' & '(Mese_MM_meno11)}>} VALORE)';

View solution in original post

8 Replies
sunny_talwar

Try like this:

SET @ORDCLI_Mese11_Y1_ValValuta = SUM({<ANNO={#(Previous_Year)},AREA={"ORD"},MESE={#(Mese_MM_meno11)}>} VALORE_IN_VALUTA );


SET @ORDCLI_Mese11_Y1_ValValuta = Replace(@ORDCLI_Mese11_Y1_ValValuta,'#','$');

Anonymous
Not applicable
Author

I'm sorry but I can not make it work.
The replace him should I enter in the Script and not in external file ??
Thank you

sunny_talwar

Should be part of the external file

Anonymous
Not applicable
Author

I inserted :the following instructions in the external file :

SET @ORDCLI_Mese11_Y1_Val€=SUM( {<ANNO={#(Previous_Year)},AREA={"ORD"},MESE={#(Mese_MM_meno11)}>} VALORE );

SET @ORDCLI_Mese11_Y1_Val€=Replace(@ORDCLI_Mese11_Y1_Val€,'#','$');

but it does not work.


sunny_talwar

Either use a dollar sign expansion on the front end or you can do this:

SET @ORDCLI_Mese11_Y1_Val€ = "=Replace(@ORDCLI_Mese11_Y1_Val€,'#','$')";

Anonymous
Not applicable
Author

Hi, the replace is not executed and the variable formula does not exist.

sunny_talwar

I guess I see what is going on... Two ways

1) Rename the First variable to something else:

SET @ORDCLI_Mese11_Y1_Val€Temp =SUM( {<ANNO={#(Previous_Year)},AREA={"ORD"},MESE={#(Mese_MM_meno11)}>} VALORE );

SET @ORDCLI_Mese11_Y1_Val€=Replace(@ORDCLI_Mese11_Y1_Val€Temp,'#','$');

2) Use this other approach

LET @ORDCLI_Mese11_Y1_Val€ ='Sum({<ANNO={$' & '(Previous_Year)}, AREA={"ORD"},MESE={$' & '(Mese_MM_meno11)}>} VALORE)';