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

Storing variable values(Calculated value of an expression) into a qvd

I want to store multiple variable values into a QVD, so that they can be used further.

I already searched in the community (https://community.qlik.com/docs/DOC-7168) and  found that,  we can store variable definition, but not the resultant value of the expression.

Eg: var vSales='Sum(sales)';

        Now I want to store into qvd the value of Sum(Sales), which is a number.

Please provide any solution, if this is possible.

6 Replies
tresesco
MVP
MVP

Could you explain with an example? Do you need to calculate the sum() or so in the script?

avinashelite

you want to store the variable definition or want to store the value got after the expression evaluation ??

Not applicable
Author

I want to store the value for the expression evaluated

Not applicable
Author

if you use the LET statement to assign the variable it evaluates the result of the expression before assigning it so:

example (value of sales = 1000:

SET vSALES = 'Sum(sales)';

vSALES value would be 'Sum(sales)'

but

LET vSALES = 'Sum(sales)';

vSALES value would be 1000

Not sure if this answers your question?

tresesco
MVP
MVP

If you are trying to use these variables in the load, you probably can use Evaluate() or simply dollar-expansion. But these depend on how exactly you need the variables output to be. If you can share a sample qvw explaining your expected output, people here would be helped to help you.

Not applicable
Author

I am not able to share the QVW because of confidentiality.

But, my expression is like  'if(sum([Fiscal Year]={'2015'}Sales)>10,"Yes","No")'

Now I want to store the value as Yes or No in the QVD, instead of the expression itself.

Thanks