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

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
qlikuserkv
Contributor III
Contributor III

Multiple lines on line chart

Hi,

In my dimension I should see the days from the beginning of the year to the max date.

I want to have 3 lines on line chart.  One line should calculate the sum of sales in 2016, another line for 2017 etc

I have date format like this

Jan 1 , Feb 1 ...

My chart should look like this

Capture.PNG

is it possible?

I calculate the  sum of sales in 2018  using this formula: SUM({$<Year = {'$(=Max(Year))'}, Month =, Quarter = , date = >}FactSoldAmount)

When I add another dimension for the previous year SUM({$<Year = {'$(=Max(Year)-1)'}, Month =, Quarter = , date = >}FactSoldAmount) lines aren't shown together. At first I see sum of sales in 2017 from January to April, and then I see sum of sales in 2018 from January to April

10 Replies
petter
Partner - Champion III
Partner - Champion III

You can also create a field named DayYearNoYTD:

  If( DayNumberOfYear(Today(1))>DayNumberOfYear(Date) , Dual(Date(Date,'MMM D'),DayNumberOfYear(Date)) , Null()) AS YearDayNoYTD

And then in your line chart turn off "Include Null Values" for the dimension DayYearNoYTD:

Screenshot from 2018-04-13 14-37-39.png

And then have simply Sum(Sales) as  the expression