Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Join us in Bucharest on Sept 18th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
gerrycastellino
Creator III
Creator III

passing variable to a variable

I have 2 variables defined,

vNumDisplay=

if(Sum($1)/1000000 >= 1, Num((Round(Sum($1)/1000000,.1))) & 'M',  

if(Sum($1)/100000 >= 1,  Num((Round(Sum($1)/1000,.1))) & 'K', Sum($1)/1000))

vES=< result of some number>

how do I structure the syntax to pass vES  into vNumDisplay in a text box ?

$(vNumDisplay$(vES)) 

$(vNumDisplay$(=vES)) 

-  all above do not work ???

1 Solution

Accepted Solutions
gerrycastellino
Creator III
Creator III
Author

this did:

=$(vNumDisplay($(=$(vES))))

View solution in original post

5 Replies
petter
Partner - Champion III
Partner - Champion III

Remove the second dollar-sign:


$(vNumDisplay(vES))

gerrycastellino
Creator III
Creator III
Author

did not work ...

gerrycastellino
Creator III
Creator III
Author

this did:

=$(vNumDisplay($(=$(vES))))

jonathandienst
Partner - Champion III
Partner - Champion III

I think you need the $ sign, but like this (at least that is how I have always done it):

     $(vNumDisplay($(vES)))

But in this case, when vES is expanded into the expression in vNumDisplay, it must make legal and semantic sense in a Sum(). I don't think a value is expected here.

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein
petter
Partner - Champion III
Partner - Champion III

Actually it worked very well for me - in the context I used it. So probably you used it in another context where it didnt work. But that is how the harder to understand parts of QlikView often works - it is very context sensitive...