Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Join us in Toronto Sept 9th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
schuffe
Contributor III
Contributor III

dynamic legend titles, based on variable

Hello everyone 🙂

I want a dynamic chart with dynamic legend titles.

So I created a variable ("vchoose").

Via Variable input i can select my created cases:

schuffe_2-1653474371299.png

In the line graph I want 2 data sets which are dependent of vchoose:

Data 1:  Pick(vchoose, A, A, B)

Data 2:  Pick(vchoose, B, C, C)

If I set vchoose  to "A and C" i can see the datasets A and C (this is working perfect for all cases). 

Now my question: how can i change the legend ?

At the moment the data is called "Pick(vchoose,A,A,B)" and "Pick(vchoose,B,C,C)".

schuffe_4-1653474735720.png

I would like to have the legend named like the data sets. 

So in this case A, B or C.

 

I hope someone can help me 😄

Thanks in advance 🙂

 

Labels (1)
1 Solution

Accepted Solutions
schuffe
Contributor III
Contributor III
Author

Hello, 

as i said before: the answer for the first problem was pretty obvious.

Just change the field name to something like

Pick(vchoose, 'A', 'B', ... )

 

The second problem was solved here:

dynamic legend titles, based on variable

View solution in original post

5 Replies
Andrei_Cusnir
Specialist
Specialist

Can you please share a sample app that will help us understand the exact use case scenario? 

Help users find answers! Don't forget to mark a solution that worked for you! 🙂
schuffe
Contributor III
Contributor III
Author

Hello, I could solve it by myself 🙂

I thought its difficult, but it was kinda obvious ^^ 

 

Thanks 🙂

schuffe
Contributor III
Contributor III
Author

Now I have another problem 😄

Same as here:

Hide nulls values in legend in charts - Qlik Community - 1552110

How can I hide the Null values in my legend. 

Sometimes I need 5 

schuffe_0-1653628591796.png

But often i just have one or two 

schuffe_1-1653628701084.png

How to hide the nulls in the legend ?

 

 

 

Andrei_Cusnir
Specialist
Specialist

Hello,

 

I am glad to hear that you were able to resolve your issue. Can you perhaps share briefly the solution that helped you resolve it? It will allow other community members with similar issue to find answers for their use case scenarios.

 

Regarding your second question: "How to hide the nulls in the legend ?", it seems that natively it is not yet supported to remove measures from legend with Null() values. You can submit a feature request [1] and elaborate in detail as to why this is going to be beneficial for you and for other users as well. You can specify that you would like to have the option to further customize the legend and generate the label only if certain condition is met. 

 

I hope that this information is helpful.  

---

[1] https://community.qlik.com/t5/Knowledge-Base/How-To-Submit-Feature-Requests-For-Qlik-Products/ta-p/1...

Help users find answers! Don't forget to mark a solution that worked for you! 🙂
schuffe
Contributor III
Contributor III
Author

Hello, 

as i said before: the answer for the first problem was pretty obvious.

Just change the field name to something like

Pick(vchoose, 'A', 'B', ... )

 

The second problem was solved here:

dynamic legend titles, based on variable