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

How to NOT Dolar Expand

Hello Everyone

I want to create a QlikView chart expresion library using the include function. This way I can centralise all the variables containing the chart expressions to diferent qlikviews with similar dataset.

I have a lot of functions depending one from the other variables (containing either functions and set analysis ) and I want to keep this dependece when the variables are loaded.

Lets say I have this expression

set Sum_Thigs_TimeSeparation =  sum( {< TimeDiff = {"$(vTimeDiff)"}>} NoOfThings)

and the user is able to set the value of vTimeDiff on the qlikview so if $(vTimeDiff) expands on the script, then it will be imposble for the user to change the outcome of this expresion. (I know, TimeDiff is a dimension on QV but selecting this dimension might affect other expresions)

I tried:

set vTimeDiff = 'Test'

1 Try:      set Sum_Thigs_TimeSeparation =  sum( {< TimeDiff = {"$(vTimeDiff)"}>} NoOfThings) 

1 Result: sum( {< TimeDiff = {"$('Test')"}>} NoOfThings)

2 Try:     set Sum_Thigs_TimeSeparation =  sum( {< TimeDiff = {"chr(36)(vTimeDiff)"}>} NoOfThings)                -- Use The Chr expresion

2 Result:     set Sum_Thigs_TimeSeparation =  sum( {< TimeDiff = {"chr(36)(vTimeDiff)"}>} NoOfThings)           -- Not Expanded

3 Try:     set Sum_Thigs_TimeSeparation =  sum( {< TimeDiff = {" '&chr(36)&'(vTimeDiff)"}>} NoOfThings)        -- Use The Chr expresion

3 Result:     set Sum_Thigs_TimeSeparation =  sum( {< TimeDiff = {" '&chr(36)&'(vTimeDiff)"}>} NoOfThings)   -- Not Expanded

4 Try:     set Sum_Thigs_TimeSeparation =  sum( {< TimeDiff = {" '&$(chr(36))&'(vTimeDiff)"}>} NoOfThings)    --- Force Chr expansion

4 Result:     set Sum_Thigs_TimeSeparation =  sum( {< TimeDiff = {" '&&'(vTimeDiff)"}>} NoOfThings)               --- Got empty value

5 Try:       set Sum_Thigs_TimeSeparation =  sum( {< TimeDiff = {"vDolar(vTimeDiff)"}>} NoOfThings)                --- Use a vDollar = '$'

5 Result:   set Sum_Thigs_TimeSeparation =  sum( {< TimeDiff = {"vDolar(vTimeDiff)"}>} NoOfThings)               --- Not Expanded

All tryes with "Let" failed vecause QlikView tryes to sum.

Any Suggestion?

1 Solution
2 Replies
Anonymous
Not applicable
Author

Thank you Sunny. This one "Stop Dollar Sign Expansion in the script (Escape Character ??? )" was really usefull