Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
andre_bento
Contributor III
Contributor III

Defining set expression with condition

Good afternoon all,

I am defining a measure that calculates the number of distinct users and applying it to a bar chart where my x-axis represents years.
My expression is the following: Count(distinct(FULL_NAME))
And I want to change this expression so that it only counts my users that are directly related with a specific year. In my current visualization one of the bars has values but it is not representing any year, this is concerning our users that haven't had any interactions with our project but that are already created and registered, I want to eliminate that column. I tried the following: Count(distinct FULL_NAME) If($(date_auto_grain) IN {$(date_auto_grain)}, 1) however I am getting the error: Garbage after expression 'If'. 

Labels (1)
4 Replies
rwunderlich
Partner Ambassador/MVP
Partner Ambassador/MVP

Perhaps the simplest way to deal with this is to uncheck "Include null values" in the chart Data properties.

rwunderlich_0-1711385570427.png

 

-Rob

andre_bento
Contributor III
Contributor III
Author

That does not resolve my issue, since the column is not with null values, what i have is a null value for the column in x-axis:

 

andre_bento_0-1711386305783.png

 

BrunPierre
Partner - Master
Partner - Master

Data handling                

Under AddOns

Uncheck >> Show zero values

rwunderlich
Partner Ambassador/MVP
Partner Ambassador/MVP

That is what I was suggesting. If you uncheck "Include null values" for your Year dimension, does the null bar disappear? 

-Rob