Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

How to make chart empty of no selections?

Hi,

I'm wondering how i can make my charts empty if I haven't made any selections?

As it is right now it shows total sales of all years I have data for instead of nothing.

And if possible I'd want the empty chart to say "please select a year" or something to that effect.

Thanks

1 Solution

Accepted Solutions
vinieme12
Champion III
Champion III

In general tab add a calculation condition.

Example

If (getselectedcount (year) >0,1,0)

This means the chart will evaluate only if a value in year field is selected

Vineeth Pujari
If a post helps to resolve your issue, please accept it as a Solution.

View solution in original post

11 Replies
vinieme12
Champion III
Champion III

In general tab add a calculation condition.

Example

If (getselectedcount (year) >0,1,0)

This means the chart will evaluate only if a value in year field is selected

Vineeth Pujari
If a post helps to resolve your issue, please accept it as a Solution.
vinieme12
Champion III
Champion III

See this thread

https://community.qlik.com/thread/158159

Vineeth Pujari
If a post helps to resolve your issue, please accept it as a Solution.
MK_QSL
MVP
MVP

Go to Chart Properties

Layout tab

Tick Conditional Show

Write Condition as below

GetSelectedCount(Year)>0

This will make your chart hidden if there is no Year selected.

But if you don't want like this.. another way is

go to General Tab

write below condition in Calculation Condition

GetSelectedCount(InvoiceYear)>0

Now in the same tab, click on Error Messages

Select Calculation Condition unfulfilled from Standard Messages

Write below in customer message

Select at least one year..

Apply OK

Not applicable
Author

Hi Manish!

I tried your expression: GetSelectedCount(InvoiceYear)>0 but it didn't work. I tried changing InvoiceYear to my variable(?) (which is Sales) but it still didn't work. Just shows the pie chart that it always does

Not applicable
Author

Hi Vineeth!

I tried your solution as well, but with the same result as I posted below (doesn't work).

In this case however, it doesnt show anything when I do select a year - so the chart always show "Please select a year".

I read the thread you linked, but I didn't manage to take anything useful away from it..

Any ideas on how to solve my problem?

A bit more specific: I have a pie-chart/bar-chart that displays how much of the sales come from various countries around the world using Sales expression.

vinieme12
Champion III
Champion III

Can you post your expression, that you entered in calculation condition

Vineeth Pujari
If a post helps to resolve your issue, please accept it as a Solution.
Not applicable
Author

I used the expression posted by you: If (getselectedcount (year) >0,1,0)

vinieme12
Champion III
Champion III

And did you replace year with your actual Year fieldname in your app?

Vineeth Pujari
If a post helps to resolve your issue, please accept it as a Solution.
Not applicable
Author

I did not, my fieldname for year is Year, assumed it would work the same but apparently not.

But now it does (with the capital Y in Year)!

Thank you a lot for your help!