Qlik Community

QlikView App Development

Discussion Board for collaboration related to QlikView App Development.

Highlighted
mostal75
New Contributor III

Script variable

Hello,

I have a variable X1 like

=sum({"MyBookmark")Amount)

created manually into my app

I would like to retrieve into my script X1 value to store in QVD.


Do you have any idea because I have errors or definition (no evaluated variable) with

   LOAD $(X1) as Amount1 autogenerate 1;

or

LOAD '$(X1)' as Amount1 autogenerate 1;

Regards

Tags (2)
2 Replies
MVP
MVP

Re: Script variable

You can't use set analysis in the script.

You would need the 'traditional' way to get your sum, i.e. using a LOAD from a data source with the field Amount and WHERE clause to filter the records.

Maybe you can create a variable to retrieve the field selections in state MyBookmark after a reload and parse this variable in the next reload to get your aggregated filtered Amount and store to a QVD.

Maybe it's easier to do all this in the UI.

mostal75
New Contributor III

Re: Script variable

Thank you very much Stefan

I've tried with a variable defined like that  vINF=sum({"MyBookmark")Amount)

In charts, $(vINF) works fine but not in script (formula retrieve, not variable value), with

LOAD '$(vINF)' as Amount1 autogenerate 1;

or

LOAD $(vINF) as Amount1 autogenerate 1;


Do you have any idea please ?


Regards