Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Qlik Sense Time Intervals on Line Chart

Hey, guys!
I'm new to Qlik Sense. I made a line chart, which has X-axis as Date and Y-axis as Sales. Now I need to add vertical lines or some marks to show on this chart time intervals (when an advertising campaign started and when it finished). Please, give all possible solutions, advises and recommendations.

Elena

1 Solution

Accepted Solutions
danansell42
Creator III
Creator III

Hi Elena

I don't think you can add vertical reference lines as you want them.

I have come up with another solution which i think looks best using markers.

You could convert it to a combo chart and add an extra measure that is an if statement.

For example:

Note - I used week numbers for my calculation and this could be converted to actual dates

Main expression = Sum(Sales)

Extra expression = if(Week= 6 or Week=10, sum(Sales))

Display the Extra expression as a Marker (could use bars but personally don't think it looks so good) and make sure colours are different.

Result would be like below.

Event Test.PNG

Hope this helps


Dan

View solution in original post

4 Replies
danansell42
Creator III
Creator III

Hi Elena

I don't think you can add vertical reference lines as you want them.

I have come up with another solution which i think looks best using markers.

You could convert it to a combo chart and add an extra measure that is an if statement.

For example:

Note - I used week numbers for my calculation and this could be converted to actual dates

Main expression = Sum(Sales)

Extra expression = if(Week= 6 or Week=10, sum(Sales))

Display the Extra expression as a Marker (could use bars but personally don't think it looks so good) and make sure colours are different.

Result would be like below.

Event Test.PNG

Hope this helps


Dan

Anonymous
Not applicable
Author

Thank you, Dan, for your quick and kind reply!

If it's not difficult for you, please explain to me how my expression will look like. It comes to me like:

If(%date='StartCamp', Sum(Sales))

where StartCamp is field's name and I want to check its values.

I appreciate

Big thanks

Elena

danansell42
Creator III
Creator III

I'm assuming %date is a date field

Therefore for my example you would need to replace 'StartCamp' with the actual date (make sure its in the same date format or it probably won't work eg 'YYYY-MM-DD' etc.).

for example:

If(%date='2016-08-01', Sum(Sales))

Dan

Anonymous
Not applicable
Author

Ok, I got it! Thank you for your help:)