Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
dirk_fischer
Creator
Creator

How to use a variable defined in the frontend during partial reload?

Hi experts,

I try to use a variable from the frontend to define the path of the file, I want to reload during a partial reload. The variable works fine, when I use it to write edited values into the file (I use the VizLib Writeback extension), but then during the reload, I don't manage to get the variable properly evaluated.

The script always uses the formula as a string and then of course, this leads to not finding the file.

I tried setting another variable by assigning the variabel (Let vPathToQvd = vPathToManualUpdatedNetplanConfig;) but then vPathToQvd contains only the string 

'If(GetPossibleCount(%PK_NETPLAN) = 1, vPathToBasicFolder & MaxString(PATH_TO_FOLDER) & ''/SAP/'' & Max([%PK_NETPLAN]) & ''_NETPLAN_CONFIG_2021.QVD'', Null())'

I tried assigning the variable as Let vPathToQvd = $(vPathToManualUpdatedNetplanConfig), but then the script fails with "unexpected token (".

Does anybody have an idea how to overcome this problem?

 

Best regards,

 

Dirk

1 Solution

Accepted Solutions
dirk_fischer
Creator
Creator
Author

Hi Marcus,

thank you for your feedback. I found that with QlikSense November 2020 accessing frontend variables during partial reload is possible. But it looks like the variable does not pass the result of a formula to the script, only the formula itself.

However, if you set the variable with an action like the button object is providing, then the variable value is available in the script during the partial reload. In my specific setup, I use a VizLib filter object to select a value  and add the action set variable to the filter. Then I can set the variable with the correct value, which is then available as a string in the script during a partial reload.

I can even use another action to intiate a partial reload, which in my case is an advantage, because then I can load only the datasets, I want to edit in another table.

 

Best regards

 

Dirk

View solution in original post

2 Replies
marcus_sommer

I assume your wanted variable-evaluation isn't possible - at least not within QlikView. In similar cases I use two variables - one with the UI expressions and another one in which a macro write the UI result as a value. It's not very nice and requires in some cases a double-reload but it's working for my scenarios.

I don't know if you could do something similar in Sense - the essential point is you need to store the variable-value in any way - maybe by storing it within another table - or the calculation must be performable within the script.

- Marcus

dirk_fischer
Creator
Creator
Author

Hi Marcus,

thank you for your feedback. I found that with QlikSense November 2020 accessing frontend variables during partial reload is possible. But it looks like the variable does not pass the result of a formula to the script, only the formula itself.

However, if you set the variable with an action like the button object is providing, then the variable value is available in the script during the partial reload. In my specific setup, I use a VizLib filter object to select a value  and add the action set variable to the filter. Then I can set the variable with the correct value, which is then available as a string in the script during a partial reload.

I can even use another action to intiate a partial reload, which in my case is an advantage, because then I can load only the datasets, I want to edit in another table.

 

Best regards

 

Dirk