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: 
arunqlik2view
Creator
Creator

How to ignore selections for variable

Hi All,

I have a chart with cities in the dimenions and  expression as given below. I want the selections to affect the numerator but not the denominator which is a variable .

Count({<[SEGMENT] = {"*ABC*"}>} DISTINCT[ITEMS]) / vAbc

------------------

Variable declaration

vAbc = Count({<[SEGMENT] = {"*ABC*"}>} [ITEMS])

Thanks in Advance,

Arun

5 Replies
YoussefBelloum
Champion
Champion

Hi,

you can detach your variable from all the selections (all the fields) using this:

vAbc = Count({1<[SEGMENT] = {"*ABC*"}>} [ITEMS])


or just detach your variable from one field, city for example:


vAbc = Count({<[SEGMENT] = {"*ABC*"},[CITIES]>} [ITEMS])

shiveshsingh
Master
Master

YOu can bypass the field that you want not to impact the output.

Define your variable like below.

vAbc = Count({<[SEGMENT] = {"*ABC*"},[City]>} [ITEMS])

arunqlik2view
Creator
Creator
Author

Thanks, you are awesome

YoussefBelloum
Champion
Champion

don't forget to close the thread if it is ok for you

dsharmaqv
Creator III
Creator III

try this

vAbc = Count({<[SEGMENT] = {"*ABC*"},Cities=>} [ITEMS])