Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Announcements

Breathe easy -- you now have more time to plan your next steps with Qlik!
QlikView 11.2 Extended Support is now valid through December 31, 2020. Click here for more information.

azimabadi
Contributor III

Problem with $ in Variable Definition in Script

Hi.

i define variables in my script. i read some data from excel fiels and construct my variables. but i have a problem wit $ in defination.

consider this :

SET yearString='Kalender.Jahr';

SET sumString = 'Field_a - Field_B';

LET mainString = '( sum ({<' &

  yearString & '={"' & '$' & '(=max(Kalender.Jahr)-' & n & ')"}>} ' &

  sumString & ' ))';

i need to get the following:

( sum ({<Kalender.Jahr={"$=max(Kalender.Jahr)-1"}>} Field_a - Field_B )) 

insted the answer is:

( sum ({<Kalender.Jahr={"(internal error)"}>} Field_a - Field_B )) 

what that is really intersting is that i used the same syntax in another qvw and it works as i expected.

Best Regards

Peyman

Tags (3)
1 Solution

Accepted Solutions
aadilmadarveet
Valued Contributor

Re: Problem with $ in Variable Definition in Script

pleace check attached..

hope that helps..

4 Replies
aadilmadarveet
Valued Contributor

Re: Problem with $ in Variable Definition in Script

just tried your script to calculate the variables..

works perfectly well.. as your expected result..

azimabadi
Contributor III

Re: Problem with $ in Variable Definition in Script

as i said it works in one qvw and exactly same syntax gives me 'Internal Error'.

azimabadi
Contributor III

Re: Problem with $ in Variable Definition in Script

here i attach the example where i get 'Internal Error'.

aadilmadarveet
Valued Contributor

Re: Problem with $ in Variable Definition in Script

pleace check attached..

hope that helps..