Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
wallerjc
Partner - Contributor III
Partner - Contributor III

Qlikview variable expression in Load Script

I have a load script and I'm trying to do the following variable:

set vTest = if('$(dialMode)'='Month',sum(Comps.SpendDollers)); 

When I run this script and look in my "Variable Overview" I can see that it's coming out to:

if('Week'='Month',sum(Comps.SpendDollers)) 

Could someone explain to me how I get the variable "dialMode" to evaluate when I use the variable in my document, and not when the Load Script is ran?

I hope I've made myself clear, please let me know if not.

1 Solution

Accepted Solutions
maxgro
MVP
MVP

maybe

let vTest2 = 'if(' & chr(39) & chr(36) & '(dialMode)' & chr(39) & '=' & chr(39) & 'Month' & chr(39) & ',sum(Comps.SpendDollers))';

View solution in original post

4 Replies
maxgro
MVP
MVP

maybe

let vTest2 = 'if(' & chr(39) & chr(36) & '(dialMode)' & chr(39) & '=' & chr(39) & 'Month' & chr(39) & ',sum(Comps.SpendDollers))';

wallerjc
Partner - Contributor III
Partner - Contributor III
Author

Are you a f***ing wizard?! That's the most disgusting expression I've seen and it works perfectly.

Is this documented anywhere?

wallerjc
Partner - Contributor III
Partner - Contributor III
Author

nevermind actually i've worked out why this is working thanks.

maxgro
MVP
MVP

sometimes it's used in set analysis

Re: Dollar sign expansion and Set Analysis?