Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Dynamic Table using Variables

Hi,

I'd like to create a dynamic table using variable that was loaded at the data load script.

In my Load Script I have the following:

let cash = 0.01;

Load *inline

[Asset_Class, Asset_Class_Name, Weight

CASH02, Cash, $(cash)];

Then on the Worksheet I was hoping to use Variable Extension( https://github.com/erikwett/qsVariable) to update the variable.

Unfortunately this did not result the table to be updated.

The reason why I'd like a table to be updated dynamically is to perform a what-if scenario where the input comes from user through the variable extension. Please let me know how I can address this issue and create the Table.

Thank you

Joon

8 Replies
bwisealiahmad
Partner - Specialist
Partner - Specialist

Hi,

Why do you want to push the variable into the load script? You can solve this in front-end.

I added an example which would work, but the input and variable is defined in front-end and then you input the data there.

See more here: Adding a variable button in Qlik Sense - Qlik Tuesday and Tricks - YouTube

Added small example as an attach

Best,

Ali A

balabhaskarqlik

It should work,

Ex:

let vRest = 1;

LOAD * INLINE [

        Value

        $(vRest)             

    ];

May be result is less, because value is 0.01.

Anonymous
Not applicable
Author

Ali,

In the later iteration, I'd like to join the table using Asset_Class as the the join attribute to perform additional calculation for  the What-If senarios. The expression without it would be heavily manual to put each value of the Asset_Class to query the expression which I'd hope to avoid. Please let me know if you know of any implementation where we can use Variable as the dynamic table or if you know better options to do so.


Joon

Anonymous
Not applicable
Author

Bala,

Thank you for the answer. Yes I can insert to table with the above. The question is to later change that value in the front-end to reflect the change. Please let me know if you know of the way to do this.

Joon

bwisealiahmad
Partner - Specialist
Partner - Specialist

Hi again,

Either you have to set it in the script so the person doing that has to have access to the script OR read it from an external file such as a excel file or text file where there given users can change the value. Keep in mind this has to be reloaded to take effect.

Is the person doing this very often or once in a while?

Få Outlook for Android<https://aka.ms/ghei36>

Anonymous
Not applicable
Author

Ali,

Thank you for the quick response. Without the reload would be the key.. We are hoping to perform what-if analysis where the user is given a slider bar to manipulate the variables and it'd come into effect as soon as they change the value. Yes I can do this by creating variables in the front end.. I was wishing to find the better solution than creating X number of variables per Asset_Class to achieve this what-if exercise.

Joon

bwisealiahmad
Partner - Specialist
Partner - Specialist

Ok...

I don't know of any way to pass a front end variable into the script so my personal opinion is that you solve this in front end with smarter use of expressions such as pick/match and set analysis.

Best,

Ali A

Få Outlook for Android<https://aka.ms/ghei36>

balabhaskarqlik

Change that value in the front-end to reflect the change, is not possible, because that's not the Dimension.