Qlik Community

Qlik Sense App Development

Discussion board where members can learn more about Qlik Sense App Development and Usage.

Announcements
BI & Data Trends 2021. Discover the top 10 trends emerging in today. Join us on Dec. 8th REGISTER
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Contributor II
Contributor II

Variable with set analysis function throws error while using in the table

Hi,

I have created a variable using set analysis function, which evaluated based on user function.

Var1 = '=only({<Month={' & '$' & '(=GetFieldSelections(Months))}>}Price)';

This variable evaulates the expression and assigns a value. $(Var1) = 10

I want to use the same variable as a measure field in a table but it throws an error.

Load

$(var1) as Price

Is this the right way to call a variable in the script.

 

3 Replies
Highlighted
MVP
MVP

Your formula uses set analysis , hence it can't be run in script as it will only work in measure in front end.  Also your using GetFieldSelections functions inside the set which is again specific to front end and can't be run in script.

Based on your requirement may be we can suggest the other way to fulfill your requirement

Highlighted
Contributor II
Contributor II

Sure. Is there any other way to create this variable which can be further used in a table to re-calculate the final price.

The variable should change every time the user selects a month.

Highlighted
MVP
MVP

Well variable can be created in many ways but it depends on the scenarios.

Would you able to provide the example of what exactly you want to do?