Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

INCLUDE Script Problems with SET VARIABLES

Hi,

i want to import Variables with the import script. Everytime i update my dashboard, the variable is correct importet and which works fine:

SET VarCount = ...  count ( {$<Reportingyear={$(=year(today))>} xyz).

Problem is when i try to import this with an include statement $(Include = ....... .txt) the variable will be imported with following error

"count ( {Reportingyear={ (internal error) } xyz)".

Is there a problem with syntax variable with include statements? Does anyone know how to solve this problem??

Thank you very much in advance....

kind regards

Jezze

1 Solution

Accepted Solutions
Miguel_Angel_Baeyens

Hi Jezze,

Whenever QlikView finds the string "$(=" it causes an internal error, although the script keeps loading without reporting it.

There are some workarounds to it, one is to use a different character instead of the "=", like "~" then do a Replace() in a different variable. Another workaround is to use LET instead of SET and use the Chr(36) sign for the dollar:

LET VarCountLET = 'count ( {$<Reportingyear={' & Chr(36) & '(=year(today))>} xyz)';

Hope that helps.

Miguel

View solution in original post

4 Replies
swuehl
MVP
MVP

I would assume you also run into trouble just using something like

SET VarCount = count ( {$<Reportingyear={$(=year(today))>} xyz);

in your script (without inlcuding from a different file), because of the dollar sign expansion.

It seems to work at your site, so I probably miss something essential here.

Could you upload a working sample qvw (with your original SET statement)? I don't think this sample must do anything else then create the variable, right?


Miguel_Angel_Baeyens

Hi Jezze,

Whenever QlikView finds the string "$(=" it causes an internal error, although the script keeps loading without reporting it.

There are some workarounds to it, one is to use a different character instead of the "=", like "~" then do a Replace() in a different variable. Another workaround is to use LET instead of SET and use the Chr(36) sign for the dollar:

LET VarCountLET = 'count ( {$<Reportingyear={' & Chr(36) & '(=year(today))>} xyz)';

Hope that helps.

Miguel

Not applicable
Author

HI Miguel,

the perfect solution is to use LET statement. It works perfectly fine!!!! Thank you very much!

King regards

Jezze

Not applicable
Author

Hey I am running into the same issue, but when i swap out the string it notes as a script line error. Any idea what's wrong?

LET vSetYTD = {$<MonthID = {"<='&chr(36)&'(=Max(MonthID))"},
Date = {
"<='&chr(36)&'(=Max(Date))"},
Year = {'&chr(36)&'(=Max(Year))},
Quarter = ,
Period = ,
[Period (#)] = ,
Month = >};

EK