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: 
Not applicable

Suppress Dimension if All Expressions Do Not Return Values

Hello,

I have a bar chart with one Dimension (Job Title) and two Expressions (avg(Hourly Rate) and (avg(Day Rate). I only want to see the dimension when it returns values for both expressions.  How is this accomplished?  I tried a select in field action as well so that the entire sheet would filter if the two expressions were true on sheet activate, but that didn't work. Please advise.

1 Solution

Accepted Solutions
MayilVahanan

Hi

Please check the attached file. Hope it helps

Thanks & Regards, Mayil Vahanan R
Please close the thread by marking correct answer & give likes if you like the post.

View solution in original post

8 Replies
MayilVahanan

hi

try like this

if(avg(Hourly Rate) <>0 and avg(Day Rate) <> 0, avg(Hourly Rate))

if(avg(Hourly Rate) <>0 and avg(Day Rate) <> 0, avg(Day Rate))

So its display if both condtion is satisfy oly

hope it helps

Thanks & Regards, Mayil Vahanan R
Please close the thread by marking correct answer & give likes if you like the post.
Not applicable
Author

Thanks for the quick reply Mayil. This didn't work, unfortunately. See attached screenshot.Capture.JPG

MayilVahanan

Hi

Can you post a sample file?

Thanks & Regards, Mayil Vahanan R
Please close the thread by marking correct answer & give likes if you like the post.
Not applicable
Author

Try the folloing as your dimension:

Aggr(if(avg(Hourly Rate) <>0 and avg(Day Rate) <> 0,Job_Title),Job_Title)

Regards

RL

Not applicable
Author

Thank you as well. Unfortunately that did not work for me either. Please see the attached example where I would want to suppress the Accounting Assistant job title from the chart because it does not have any Daily Rates data to show.

MayilVahanan

Hi

Please check the attached file. Hope it helps

Thanks & Regards, Mayil Vahanan R
Please close the thread by marking correct answer & give likes if you like the post.
Not applicable
Author

Thanks!

danielact
Partner - Creator III
Partner - Creator III

Another way to do it is with this expression:

=Aggr(if(isnull(avg(Hourly_Rate)) =0 and isnull(avg(Daily_Rate)) = 0,Job_Title),Job_Title)

The issue earlier was that you were using zero in your logic. It was blank, meaning a null value, not zero.