Skip to main content
Woohoo! Qlik Community has won “Best in Class Community” in the 2024 Khoros Kudos awards!
Announcements
Nov. 20th, Qlik Insider - Lakehouses: Driving the Future of Data & AI - PICK A SESSION
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Display Active Group in Title

Hi All,

Lets say I have a cyclic group such as Time that has used fields Year - Quarter - Month- Date. If I use this group in the chart I know the current Field being displayed gets displayed next to the cycle icon. Is there any way to also use this in the title, ie change the title from Revenue by Year to Revenue by Quarter when the user selects it.

Thanks,

J

1 Solution

Accepted Solutions
Not applicable
Author

Ok, this idea is a little odd, but is seems to work. When creating the expression for each group item add a comment at the end:

=Year(date_field)
//Year


For the comment, use what you would want for your label (keep the label in place, because this does not replace normal label functionality). Then when you want to get the (fake) label of the selected group, use:

=SubField(GetCurrentField(Tester), '//', 2)


View solution in original post

10 Replies
rwunderlich
Partner Ambassador/MVP
Partner Ambassador/MVP

See function GetCurrentField().

='Current Field is ' & GetCurrentField(groupname)

-Rob

Not applicable
Author

Hmm, that is almost what I need. What if my group is based on some expressions ie for Year I have the expression = Year(date_field). I have this labelled as Year in the group. Is there a way to display the label and not the actual expression?

Thanks,

J

montubhardwaj
Specialist
Specialist

While creating a group, you can give the desired label name to the fields/Expressions. So when you cycle it, you will get the Labeled name only in the title after using the function (as suggested by Rob) in Title in General tab.

Regards,

Sharma

Not applicable
Author

I do have labels in my group specified already... but when I use GetCurrentField it returns the expression, not the label. Tongue Tied

Not applicable
Author

Ok, this idea is a little odd, but is seems to work. When creating the expression for each group item add a comment at the end:

=Year(date_field)
//Year


For the comment, use what you would want for your label (keep the label in place, because this does not replace normal label functionality). Then when you want to get the (fake) label of the selected group, use:

=SubField(GetCurrentField(Tester), '//', 2)


Not applicable
Author

In my case, the group is created in the Expressions section (which is not having name). what could I could?

montubhardwaj
Specialist
Specialist

hi Miller,

Very interesting thought...

Kudos...!!

montubhardwaj
Specialist
Specialist

Hi Felmasri,

Give name ie Label to each expression and then group them. So when you cycle it around, the corresponding Title will appear on the graph.

Cheers,

Sharma

Not applicable
Author

I do not want to see it just in the chart, but I would like to use the expression labels in titles.