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

Announcements
Qlik Connect 2026! Turn data into bold moves, April 13 -15: Learn More!
cancel
Showing results for 
Search instead for 
Did you mean: 
montubhardwaj
Specialist
Specialist

How to get Vertical reference lines parallel to Y axis ?

Hi folks,

I am having little problem displaying Reference lines parallel to Y axis. Here is the description:

I have a filed "Month" which holds data for 3 years (in format like Jan-10 through Dec-10,Jan-09 through Dec-09,Jan-11-Dec-11).I want to plot expression (say Sum(Sales)) against this dimension and it is working all fine. Now I want to have reference lines at the end of each year i.e. on Dec-09, and Dec-10 . The "Month" field in not a calculated dimension and is directly from DB.

I have attched the sample layout below.Need your suggestions.

error loading image

22 Replies
jonathandienst
Partner - Champion III
Partner - Champion III

Can you upload something so we can have a look at it?

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein
montubhardwaj
Specialist
Specialist
Author

Hi,

I have attached a sample apps.... in this I am using Months and Sales.I want the refrence lines parallel to Y axis when a year ends i.e. at Dec-10 and Dec-11, it should show two lines.

Thanks fr giving it a shot.

jonathandienst
Partner - Champion III
Partner - Champion III

OK, got it working with reference lines up to two years. See if this is what you want.

I have included a straight table that shows how you need to handle dates if they are in string format like in this example.

I would convert the Month field to proper dates durng the load as I suggested in a previous post. This would make the expressions on the reference bars a lot simpler.

You will notice that the dimension of the chart is now a calculated value that converts the string to a date, and the x axis is continuous.

The reference bar expression calculate the minimum year and paint a bar at min rank 0 and min rank 1. The '- 15' paints the reference lines between the bars on the chart.

Jonathan

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein
montubhardwaj
Specialist
Specialist
Author

Hi Jona,

Thanks much. I did the similar way, and after changing to calculated dimension, Dates are displaying in very weird fashin on X-axis.Please see below. How can i fix this issue now ?

jonathandienst
Partner - Champion III
Partner - Champion III

Set the number format for the "Continuous X-axis" in the chart Properties | Number tab to the date format you need.

Jonathan

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein
montubhardwaj
Specialist
Specialist
Author

Thx Jona. But the graph I am getting is very wierd now. I dont think it is right one.Is making axis to "Continuous" causing this problem ? See below:

kji
Employee
Employee

Make sure your sort-order for the Dimension is Numeric

montubhardwaj
Specialist
Specialist
Author

Finally...!!!! Got it guys... Thx Jona and Johan and all u member for ur help....!!!

Jus small doubt, after getting reference lines successfully, Month are appearing like Jan-10,Mar-10,May-10,Jul-10 etc i.e it is skipping one month in between. I dont have any problem with this but just asking out of curiosity Wink

kji
Employee
Employee

This is probably due to not having enough space to print each month without texts overlapping, if you make chart wider i think all months will appear.

lmonincx
Creator II
Creator II

Hi Jonathan, Can you tell how you managed to get the X- axis working, in my qvw it's greyed and i can't get it selectable in a barchart?

Kind regards,

Linda