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

Default to a certain value

Hi,

I have an sample script below

Test:
load '$(autoGenValue)' as Test
AutoGenerate(1);

Let autoGenValue = 'Default';

Following is from my dashboard.

jpjust_0-1644337587255.png

When I input "ABCD" and hit the reload button, the KPI changes to ABCD. 

When I open next time the app, it defaults to ABCD, which I don't want. I wanted to default to a value as "Default"

Is it possible to achieve it?

Thanks

4 Replies
Digvijay_Singh

You may achieve this using one more variable which you can set and clear with Button and sheet actions.

Sample app is attached.

 

jpjust
Specialist
Specialist
Author

Thank you so much Vijay.

 I am incorporating your idea into my actual app with SQL statements. Will be able to complete it soon, I will keep you updated.

jpjust
Specialist
Specialist
Author

Hi Vijay - Attached is an qvf. Also I have attached the sample source excel file with just few records of sample data.

The app has an extension (Variable Reload) that I got from here: https://community.qlik.com/t5/New-to-Qlik-Sense/Update-a-script-variable-from-a-sheet-in-Qlik-Sense-...

So when an data is entered on the input field and when the button is hit, then a dynamic query is sent to the source to get data for that entered data.

That works good but the additional  requirement that I am facing is, when some one else opens the report, current date should be passed to the variable and the data should get updated on the fly for the current date. Right now, when I close the report after fetching the data for 1/2/2022 and if anyone else opens the report, it opens with 1/2/2022 that I had before, rather I want the report to be opened for the current data. Is this possible?

Also, I want to know instead of that extension if there is any other way of achieving what I am trying to do?

Thanks

 

jpjust
Specialist
Specialist
Author

Attached the source file with some dummy data