Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

How to define dimension for a variable

Hi everyone,

I'm quite new and need some help understanding the behavior of a variable in a straight table

This expression works as expected when it is used directly in my chart (return a 'Y' or 'N' correctly for that row in the cart):

          =If(Mod([Ask Amount],25) = 0, 'Y','N')

    

However, I attempted to create a variable for this expression, v25 = If(Mod([Ask Amount],25) = 0, 'Y','N')   , so could reference this expression in a few different charts, and it when I do so, it returns 'N'  for all rows.  I believe this is happening because it is calculating based on the sum of all rows, rather than by the dimension I have selected in my chart.  Is there a way to embed a dimension in this expressions so I can use this as a variable?

Thanks,

Grace

1 Solution

Accepted Solutions
rwunderlich
Partner Ambassador/MVP
Partner Ambassador/MVP

Make sure you define the variable without an "=" in the contents.

Then use the variable in a chart expression like:

$(v25)

-Rob

http://masterssummit.com

http://robwunderlich.com

View solution in original post

2 Replies
rwunderlich
Partner Ambassador/MVP
Partner Ambassador/MVP

Make sure you define the variable without an "=" in the contents.

Then use the variable in a chart expression like:

$(v25)

-Rob

http://masterssummit.com

http://robwunderlich.com

Not applicable
Author

Perfect! Thanks!