Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

baarathi
Contributor

Accessing variable

Is it possible to use variable declared in one app to be used in another app?

For Example : If Let varLastReload = 8 in Qliksense app named as Temp1

                        Can I use Let varLastExec = '$(varLastReload)' in another qliksense app Temp2  which refers to varLastReload in Temp1

8 Replies
MVP
MVP

Re: Accessing variable

no.

But you can store this variable in a QVD file and load it again in other model

LastExec:

LOAD

      '$(varLastReload)'   as LastReload

autogenerate(1);


store LastExec into LastExec.qvd ;




in other model you can just load the LastExec.qvd

baarathi
Contributor

Re: Accessing variable

Alessandro Furtado, Can you please let me know about the use of autogenerate(1) in the above script?

Digvijay_Singh
Honored Contributor III

Re: Accessing variable

autogenerate is the way to create qlik sense table records manually in the script. 'One' means one row. So you are actually storing variable value in a table field and then storing/persisting it as qvd which can be read in any other application.

baarathi
Contributor

Re: Accessing variable

instead of having a fixed value as 1, is it possible to have n rows?

Highlighted

Re: Accessing variable

Can you advise the context of your question ?  As in what end result you are after.

baarathi
Contributor

Re: Accessing variable

@Bill Markham, I want to create a log of last reload date.

ID    Date

1      1st Reload Date

2      2nd Reload Date

..            .....

n)      nth reload date    

Re: Accessing variable

I do that by incrementally loading the reload run date etc.... into a QVD.

Digvijay_Singh
Honored Contributor III

Re: Accessing variable

Yes, you can. It depends on how do you want to use it. If I understand your need correctly, you can add this one row in last created QVD by first loading the QVD and adding new record through autogenerate using concatenate keyword.