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

Announcements
Qlik GA: Multivariate Time Series in Qlik Predict: Get Details
cancel
Showing results for 
Search instead for 
Did you mean: 
martyn_birzys
Creator
Creator

Problem saving variables that contain GetFieldSelections

I have two list boxes where user can select single value, and an input box. I have variables that pick up values using GetFieldSelections. When script is reloaded, a table containing one row is created, which is then joined to existing table values. My problem is that variables which set values using GetFieldSelections come across as formula not as value, i.e. '=GetFieldSelections(UserName)', instead of 'John'.

I've tried different syntax but could not get it working, any idea why? The app attached.

Scenario:

Load

'$(vSelectedName)' as User,

'$(vSelectedPeriod)' as ScenarioDate,

'$(vInput)' as [My Variable]

AutoGenerate (1);

Scenario:

LOAD *

FROM

Scenario.qvd

(qvd);

STORE Scenario into Scenario.qvd (qvd);

screenshot1.png

screenshot2.PNG

1 Solution

Accepted Solutions
martyn_birzys
Creator
Creator
Author

Thanks for the link Sunny, it works using triggers.

For anyone who is new to triggers like me, go to Settings / Document Properties / Trigger tab. Select Document Event Trigger called OnAnySelect, click Edit Action and create SetVariable Action.

screenshot3.PNG

and then edit the script:

let vSelectedName = '$(vaSelectedName)';

let vSelectedPeriod = '$(vaSelectedPeriod)';

Scenario:

Load

'$(vSelectedName)' as User,

'$(vSelectedPeriod)' as ScenarioDate,

'$(vInput)' as [My Variable]

AutoGenerate (1);

Scenario:

LOAD *

FROM

Scenario.qvd

(qvd);

STORE Scenario into Scenario.qvd (qvd);

Final app attached.

NOTE: The SAVE button only works in QlikView Desktop environment, it does not work on Access Point. There may be ways of doing it, but it is sufficient for me to have it working in Desktop.

View solution in original post

4 Replies
sunny_talwar

Look at this post, Why variable with formula in script don't have the value , but the formula?‌, this should guide you in the right direction

Best,

Sunny

Not applicable

Hey, I guess trigger is the option for this.

martyn_birzys
Creator
Creator
Author

Thanks for the link Sunny, it works using triggers.

For anyone who is new to triggers like me, go to Settings / Document Properties / Trigger tab. Select Document Event Trigger called OnAnySelect, click Edit Action and create SetVariable Action.

screenshot3.PNG

and then edit the script:

let vSelectedName = '$(vaSelectedName)';

let vSelectedPeriod = '$(vaSelectedPeriod)';

Scenario:

Load

'$(vSelectedName)' as User,

'$(vSelectedPeriod)' as ScenarioDate,

'$(vInput)' as [My Variable]

AutoGenerate (1);

Scenario:

LOAD *

FROM

Scenario.qvd

(qvd);

STORE Scenario into Scenario.qvd (qvd);

Final app attached.

NOTE: The SAVE button only works in QlikView Desktop environment, it does not work on Access Point. There may be ways of doing it, but it is sufficient for me to have it working in Desktop.

sunny_talwar

Not a problem, I am glad I was able to guide you in the right direction