Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

help needed on variable

can any one please tell me that how can I store expression result in a variable

thanks in advance

ab prince

6 Replies
SunilChauhan
Champion II
Champion II

you can write directly expression into variable

ex:

var =sum(amount)

Sunil Chauhan
Not applicable
Author

thanks sunil for prompt reply,

but I want to store a straight table column expression result in variable

swuehl
MVP
MVP

I don't think you can pass a straight table columns expression result directly into a variable.

But you can try rebuilding the table result within an expression, using advanced aggregation. You would need to give us some more details, if you like some help on that.

If you want to reuse the columns result in another column of the same table, try using the expression label referencing or column() function.

Regards,

Stefan

Not applicable
Author

Thanks Stefan

Please give me some time I am trying to provide you more details.

but can you tell me which advance aggregation I will use to preserve to result in variable

swuehl
MVP
MVP

I am talking about the aggr() function. This function could be used to e.g. retrieve a total value for an expression that needs to be grouped by dimensions, for example if you want to get the max value of sum of Days Worked per Week per Employee, like max(sum( hours), Employee, Week)

This would be equivalent to build a table with Employee and Week as dimensions, sum(hours) as expression and looking for the max value (e.g. by total mode max of rows in a straight table).

This is only a simple and short example.

There are some requirements that you may handle with the use of the aggr() function, and others you may not.

Not applicable
Author

Thanks Stefan