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

Announcements
See why IDC MarketScape names Qlik a 2025 Leader! Read more
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Dynamic labels for line chart legend.

Hello,

I have a line chart with "Month" as the first dimension, "Year" as the second dimension, and "Sales" as the expression. Every line in the graph represents a different year (2012,2013,2014), so you can compare monthly sales for each year. I need to create a dynamic labels for the "Year" legend. Next to each year, i want to display in addition to the year number, the total sales for the year.

Any ideas?

Thanks

2 Replies
veidlburkhard
Creator III
Creator III

I don't think that this is possible, but why don't you try this solution: Re: Can I add label to lines inside chart?

Not applicable
Author

Danny,

You cannot modify the legend as you wish (add some characters). You can try the following to see if the trick may suit you:

un check the legend

check Values on data point

modify your expression to use the dual function, sth that will return a single value, at the last displayed value:

dual(if(Month = Max(Total Month), Year & '  ' & Sum(Total Sales), ''), Sum(Sales))

The first part of the dual is the text part that will be displayed (we have checked the data point)

This text part will be displayed fr the last month only

The text being displayed is the year and the sales.

The numeric part of the expression will be used to draw the chart: Sum(Sales)

Fabrice