Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Conditional chart display

Hi,

I have 21 lines of data feeding into a graph.

Is it possible to only show that graph if say more than 10 of them are selected?

Once the graph is displaying a lower number of data lines than the original 21 often the axis parameters are out of proportion. Is there anyway to have the axis automatically adjust to be more relevant tot he data fields?

Thanks 

1 Solution

Accepted Solutions
Not applicable
Author

Yes, you can use:

GetSelectedCount(YourFieldName)>2 and GetSelectedCount(YourFieldName)<10

For the second part, you can use an expression in the min and max of the axes to adjust it however you want. Under Chart Properties > Axes you can add a static min and max.  For example, using this expression will make the max axis value always 500 more than the max of the Sum(Revenue):

=max(aggr(sum(Revenue),MonthYear))+500

In this example, I am using Sum(Revenue) as the line chart expression and MonthYear as the x-axis.

View solution in original post

5 Replies
Not applicable
Author

Under Layout > Conditional, you can use GetSelectedCount(YourFieldName)>=21.

Not applicable
Author

Thanks for this.

It works perfectly.

Have you any ideas on the second question?

Thankyou

Not applicable
Author

Apologies,

is there a way to add in an "and"? for example greater than 2 but less than 10

Not applicable
Author

Yes, you can use:

GetSelectedCount(YourFieldName)>2 and GetSelectedCount(YourFieldName)<10

For the second part, you can use an expression in the min and max of the axes to adjust it however you want. Under Chart Properties > Axes you can add a static min and max.  For example, using this expression will make the max axis value always 500 more than the max of the Sum(Revenue):

=max(aggr(sum(Revenue),MonthYear))+500

In this example, I am using Sum(Revenue) as the line chart expression and MonthYear as the x-axis.

Not applicable
Author

Thanks very much. That works perfectly