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

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
alwinsch
Creator
Creator

Set fieldname in manual Variable for use in pivottable

Hi,

I created a button, on which i put an action setting the value of variable

but in that variable i want to store the name of a field used in my import script

So later on i can use my variable in a pivot table

for example

- action on button --> = if(V_NP = NP, NP, Comm)

- NP and Comm are fields  of my import script

in my pivot table i want to create an expression

=sum(V_NP)

--> and the result depends on the value of V_NP, to which field it points at the import script

How can i do this?

Kind regards

Alwin

1 Solution

Accepted Solutions
Jason_Michaelides
Partner - Master II
Partner - Master II

So fields NP and Comm have already both been loaded by the script, correct?  If so, then set your variable V_NP to be:

Sum(NP)

Your button action should be =IF(V_NP='Sum(NP)','Sum(Comm)','Sum(NP)')

Your chart expression should be =$(V_NP)

Hope this helps,

Jason

View solution in original post

2 Replies
Jason_Michaelides
Partner - Master II
Partner - Master II

So fields NP and Comm have already both been loaded by the script, correct?  If so, then set your variable V_NP to be:

Sum(NP)

Your button action should be =IF(V_NP='Sum(NP)','Sum(Comm)','Sum(NP)')

Your chart expression should be =$(V_NP)

Hope this helps,

Jason

alwinsch
Creator
Creator
Author

Thank you Jason,

It is just what i need.

Thanks,

Alwin