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

only one serie

Hello everybody,

I have a pivot table and the same pivot table as a line chart.  There are as many series as columns wich depends on the selections. Good.

But I want to show the chart only if there is one serie AND WITHOUT changing the selection : if there is one column, I can see the chart ; if there are more than one column, I do not want to see the chart.  I am looking for which property of the chart (or pivot table) to use to create a condition in the "layout - show - conditional" property of the chart.

It is probably very easy but I am a new QV user and I apologize.

1 Solution

Accepted Solutions
Not applicable
Author

Thank you Stefan,

I found a solution.

To fix ideas, for example, a pivot table with 4 dimensions for the columns, X1, X2, X3, X4 and 1 for the rows, X5.  This configuration can give me a table with 0 or several columns : it depends on current selection on these or other fields.

In the "layout - show - conditional" property of the chart, I use the condition "count( distinct X1& '$' & X2 & '$' & X3& '$' & X4) = 1", where $ is a separator not used in the values of the four dimensions.  This solution is not perfect but it is good for my problem (not perfect, because, I have to "freeze" the pivot to have all time the same fields in column).

I consider that the solution is found but I would be happy if a more elegant solution was found...

Thank you,

Pierre

View solution in original post

2 Replies
swuehl
MVP
MVP

It may depend a little on the design of your dimensions / data model. I assume that you are just using two fields in a pivot table / line chart, one dimension pivoted to the top, that's what you call columns then, right?

You could probably just use

=if(GetPossibleCount(FIELDNAME)=1,1,0)

for your conditionally show expression, replace FIELDNAME with your field name you used for the columns /series dimension.

Hope this helps,

Stefan

Not applicable
Author

Thank you Stefan,

I found a solution.

To fix ideas, for example, a pivot table with 4 dimensions for the columns, X1, X2, X3, X4 and 1 for the rows, X5.  This configuration can give me a table with 0 or several columns : it depends on current selection on these or other fields.

In the "layout - show - conditional" property of the chart, I use the condition "count( distinct X1& '$' & X2 & '$' & X3& '$' & X4) = 1", where $ is a separator not used in the values of the four dimensions.  This solution is not perfect but it is good for my problem (not perfect, because, I have to "freeze" the pivot to have all time the same fields in column).

I consider that the solution is found but I would be happy if a more elegant solution was found...

Thank you,

Pierre