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: 
Not applicable

Tricky Variable - Use Field Value as Variable Name and return the Variable Value in Table

Hi All,

Can anyone tell me how to use Field value as Variable Name and return the Variable Value in Table? The scenario is a little bit complicated. A case is provided to explain as below, hope it could help. Thanks!

1. A source table with below structure is loaded into Qlikview:

user_idkpi_idItem DescItemVariableNameDefault Value
A1NotificationntfvK1_ntfON
A1Notification Time Intervalntf_intvK1_ntf_int30
A2NotificationntfvK2_ntfOFF
A2Notification Time Intervalntf_intvK2_ntf_int60

2. In Variable Overview, below 4 variables are created:

vK1_ntf

vK1_ntf_int

vK2_ntf

vK2_ntf_int


- The above 4 variable names are same as the [VariableName] in the source table.

- The initial value of the above 4 variables are assigned according to the [Default Value] in the source table.


Variable NameValue
vK1_ntfON
vK1_ntf_int30
vK2_ntfOFF
vK2_ntf_int60

Now,

the value of these 4 variables are allowed to modified on the interface (By Input Box Object). In order to compare the [Default Value] / [New Value] of variables and exporting this table to external, a table is created and the expected result is shown as below:

user_idkpi_idItem DescItemVariableNameDefault ValueNew Value

Idea to get

[New Value]

A1NotificationntfvK1_ntfONOFF$(vK1_ntf)
A1Notification Time Intervalntf_intvK1_ntf_int3060$(vK1_ntf_int)
A2NotificationntfvK2_ntfOFFON$(vK2_ntf)
A2Notification Time Intervalntf_intvK2_ntf_int

60

90$(vK2_ntf_int)








My idea is to call those variables in the Expressions of the Table for each row based on the [VariableName] such that [New Value] can be returned.

However, I have no idea how to use [VariableName] to call the variables. Or can the field value ([VariableName]) be used as individual variable name and return its value?

The above scenario is also attached in QVW. Some of the method are tried but all are unexpected result. Hope if anyone can help me. Thanks in advance!

T.NG

23 Replies
michael_klix
Creator II
Creator II

Will do tomorrow. But meanwhile maybe a very simple approach: how to export a list of all variables and their values?

Von meinem iPhone gesendet

Am 07.11.2017 um 19:25 schrieb Stefan Wühl <qcwebmaster@qlikview.com<mailto:qcwebmaster@qlikview.com>>:

Qlik Community <https://community.qlik.com/?et=watches.email.thread>

Tricky Variable - Use Field Value as Variable Name and return the Variable Value in Table

Antwort von Stefan Wühl<https://community.qlik.com/people/swuehl?et=watches.email.thread> in QlikView App Development - Komplette Diskussion anzeigen<https://community.qlik.com/message/1377073?et=watches.email.thread#1377073>

michael_klix
Creator II
Creator II

Cool hint, but our IT does not allow macros 😕

Von meinem iPhone gesendet

Am 08.11.2017 um 11:48 schrieb Stefan Wühl <qcwebmaster@qlikview.com<mailto:qcwebmaster@qlikview.com>>:

Qlik Community <https://community.qlik.com/?et=watches.email.thread>

Tricky Variable - Use Field Value as Variable Name and return the Variable Value in Table

Antwort von Stefan Wühl<https://community.qlik.com/people/swuehl?et=watches.email.thread> in QlikView App Development - Komplette Diskussion anzeigen<https://community.qlik.com/message/1377528?et=watches.email.thread#1377528>

marcus_sommer

The variables (like all other qvw-objects) could also be read from the exported document layout: Re: object id sheet name model.

- Marcus