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: 
ted_tan
Contributor II
Contributor II

Show only data labels for latest data point in Qliksense line chart, no vizlib

 

Hi Guys,

On the line chart, you can only choose to show all data points label or not show label. Can you hide the labels to only show latest data point without the use of vizlib.? 

I am trying to use measure by expression and my current syntax is this:

rangeavg(above (COUNT({<WEEKLY_NAME=, MONTHLY_NAME=, QUARTERLY_NAME=, YEARLY_NAME=, CAL_YEARLY_NAME =>) distinct CASE_REFERENCE_NUMBER),0,1f(vView=1,100,if (vView=2,24,if (vView=3,8,2)))))))

How do i nest the above in a dual function? Or any other alternatives are welcome. Thanks in advance

*vView is my variable

 

Thanks!!

Labels (1)
5 Replies
ted_tan
Contributor II
Contributor II
Author

@SRA able to offer your advice🙏

rwunderlich
Partner Ambassador/MVP
Partner Ambassador/MVP

You can make it easier to wrap in a dual by putting the expression in a Master Measure, then reference the measure in the Dual. Like for a Measure named "Sales". 

Dual( if(Year=Max(TOTAL Year), num(Sales, '#,##0'), ''), Sales )

-Rob

ted_tan
Contributor II
Contributor II
Author

@rwunderlich I will try it out. How do I show only the latest data point on the line chart? Thank you

Lech_Miszkiewicz
Partner Ambassador/MVP
Partner Ambassador/MVP

Hi @ted_tan 

Rob already provided you with the answer to that. The If() statement checks it for max() dim value and produces label for it, for all other data points it also produces label but that label is empty. You just have to apply this to your measures and dimensions.

Bottom line is we are enabling labels for all data points but you trick it to only show last value

Lech_Miszkiewicz_0-1744775638987.png

 

cheers Lech, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful to the problem.
ted_tan
Contributor II
Contributor II
Author

Hello all , followed the advice of @rwunderlich to put it as a master measure. however am facing errors as I do not have the portion highlighted in orange below

Dual( if(Year=Max(TOTAL Year), num([my master measure], '#,##0'), ''), [my master measure] )

How do i nest the master measure in a Dual then? thank you. below is the original script and a brief explanation  that makes up the master measure:

rangeavg(above (COUNT({<WEEKLY_NAME=, MONTHLY_NAME=, QUARTERLY_NAME=, YEARLY_NAME=, CAL_YEARLY_NAME =>) distinct CASE_REFERENCE_NUMBER),0,1f(vView=1,100,if (vView=2,24,if (vView=3,8,2)))))))

 

Explanation: when user selects '1' on my dashboard, it will count 100 rows, etc.

Thank you