Skip to main content
Announcements
See what Drew Clarke has to say about the Qlik Talend Cloud launch! READ THE BLOG
cancel
Showing results for 
Search instead for 
Did you mean: 
EdgarMM
Contributor III
Contributor III

Set Analysis setence store into a variable?

Hi there:

      I'm pretty new in Qlikview and I'm trying to store a hole set analysis sentence into a variable and use this variable into several graphs and pivot tables; the objective of this is only to change the content of the variable and not to change the graphs or the dynamic tables every time a change is required; is there a way to do it or it is only posible store part of the set analysis sentence into the variable?

Example:

        What I want to store but it does not work:

         vMXAct = sum({$<[Source]={'Actual'}, [Country]={'MX'}>} AMOUNT)

 

        The only way I found it works is like this:

         VMXAct = [Source]={'Actual'}, [Country]={'MX'}

       In the graphs and pivote tables:

         =Sum({$<$(=vMXAct)>} AMOUNT)

 

Thanks in advanced for your help.

Regards,

Edgar.

1 Solution

Accepted Solutions
Vegar
MVP
MVP

Consider this script:

SET vMXAct = sum({$<[Source]={'Actual'}, [Country]={'MX'}>} AMOUNT);
LOAD * inline [
Source, Country, AMOUNT
Budget, MX, 100
Actual, MX, 110
Budget, SE, 90
Actual, SE, 95
];

It will give this output:

Vegar_0-1586896697579.png

 

See attached qvw

View solution in original post

2 Replies
Vegar
MVP
MVP

Consider this script:

SET vMXAct = sum({$<[Source]={'Actual'}, [Country]={'MX'}>} AMOUNT);
LOAD * inline [
Source, Country, AMOUNT
Budget, MX, 100
Actual, MX, 110
Budget, SE, 90
Actual, SE, 95
];

It will give this output:

Vegar_0-1586896697579.png

 

See attached qvw

EdgarMM
Contributor III
Contributor III
Author

Thank you very much ¡¡, it works perfectly 😀