Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

How to plot vertical reference line with labels on either side of the line

I need to plot a vertical reference line to show Allocations till previous month and from current month onwards I need to label the graph as Actuals. I have attached a sample graph that I need

I have ProjectMonth on the X axis. Currently the Continuous option is greyed out under the Reference line tab. So I tried to make my dimensions as continuous but my expressions disappear. Can anybody please help how to do it and how to make the necessary labels appear on the right and left side of the graph.

6 Replies
jonathandienst
Partner - Champion III
Partner - Champion III

Is your ProjectMonth field a numeric date field, or is it a string? Continuous axes are not possible with text dimensions.

If you post a sample qvw illustrating the problem, it will be possible to provide more detailed and accurate help.

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein
Anonymous
Not applicable
Author

Hi Jonathan

My X axis is a string. Will post the qvw file in few mins.

Anonymous
Not applicable
Author

Here's my qvw file

jonathandienst
Partner - Champion III
Partner - Champion III

Then convert it during the load to a numeric date field:

LOAD ....

     Date#(ProjectMonth, 'MMM-yyyy') as ProjectMonth,

     ...

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein
Anonymous
Not applicable
Author

Hi

I have used   monthname( Date#(ProjectMonth, 'MMM-YYYY'),0) as ProjectMonthin the script during load. When I plot the graph it show the X axis in digits for 42... etc not the regular months.

I also tried using the Continuous option in the reference chart with the following expression but it doesn't seem to work

count(if(ProjectMonth< MonthName(today()) and aggr(sum({<PlanType={'Actuals'}>}HCM),ProjectMonth,[Resource ID] )<=0.7, [Resource ID],
if(ProjectMonth>= MonthName(today()) and aggr(sum({<PlanType={'Allocation'}>}HCM),ProjectMonth,[Resource ID] )<=0.7, [Resource ID]

)

))

Anonymous
Not applicable
Author

I managed to get the vertical line but I am not able to get the labels to appear on the top.. Any suggestions?