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

Announcements
Join us in Bucharest on Sept 18th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
Peony
Creator III
Creator III

An issue with a variable with parameter

Hi all. Please, could anyone give a piece of advice regarding an issue described below. 

I created a variable with parameter v_Total_Dollar_Sales = Sum({<$1>} Dollar_Sales).
Also, I created a variable with list of fields that should be applied to $1 parameter v_Chicken_Dim_Total_Exclude = '%Chicken_Brand=, %Chicken_Segment=, %Chicken_Retailer=, %Chicken_Subcategory='
But when I applied it only %Chicken_Brand appeared in set analysis. Why is it so?

=$(v_Total_Dollar_Sales($(v_Chicken_Dim_Total_Exclude)))

Peony_0-1742073664574.png

 

Labels (2)
1 Solution

Accepted Solutions
ramchalla
Creator II
Creator II

Hi Peony,

you need to prefix = to the definition of the variable.

Variable Name:    v_Chicken_Dim_Total_Exclude

Variable definition   ='%Chicken_Brand=, %Chicken_Segment=, %Chicken_Retailer=, %Chicken_Subcategory='

ramchalla_0-1742102896867.png

 

 

 

View solution in original post

4 Replies
ramchalla
Creator II
Creator II

Hi Peony,

you need to prefix = to the definition of the variable.

Variable Name:    v_Chicken_Dim_Total_Exclude

Variable definition   ='%Chicken_Brand=, %Chicken_Segment=, %Chicken_Retailer=, %Chicken_Subcategory='

ramchalla_0-1742102896867.png

 

 

 

marcus_sommer

Each comma within a variable-value will be treated as parameter-delimiter. There is no way to mask them but of course (quite ugly) workarounds to replace the commas in the creation as well within the call again.

Much better is to avoid the comma-stuff itself by dividing the content into n ones and/or to use a comma-free syntax - this may look like:

v: sum({ < $1, $2 >} Value)
$(v(a =, b =))

v: sum({ $1} Value)
$(v(< a = {(x|y|z)} > * < b = {(1|2|3)} >))

Peony
Creator III
Creator III
Author

@ramchalla thank you! 

Peony
Creator III
Creator III
Author

@marcus_sommer interesting idea. thank you for this hint