Qlik Community

Qlik Sense App Development

Discussion board where members can learn more about Qlik Sense App Development and Usage.

Announcements
QlikWorld, June 24-25, 2020. Free virtual event for DI and DA gurus. Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Creator
Creator

Line Chart Current Year Vs Last Year

Hi All,

PFA image.

I have a line chart showing current year trend and previous trend.

But the issue is with current year trend. For current year i am taking JAN to OCT but the line is connecting to NOV and DEC with the value 0.

i don't want to connect it to Nov and Dec. i have selected the option "Show as gaps" also still it is not working as expected.

My Expression for Current Year  --  sum({<Year={'$(Max(Year))'}>}values)

Can anyone suggest me how to resolve it.

Thanks in advance.

Rathnam.

1 Solution

Accepted Solutions
Highlighted
Creator II
Creator II

Re: Line Chart Current Year Vs Last Year

if(sum({<Year={'$(Max(Year))'}>}values)=0,null(),sum({<Year={'$(Max(Year))'}>}values))  write this expression and in add on tab uncheck include zero value

View solution in original post

6 Replies
Highlighted
Contributor III
Contributor III

Re: Line Chart Current Year Vs Last Year

hello muniratham ,

for current year u can this expression

Sum({<OrderDate={">=$(=(YearStart(Max(OrderDate))))<=$(=Max(OrderDate))"},Year=,Month=>} [values])

and for previous year u can use this expression,

Sum({<OrderDate={">=$(=(YearStart(Max(OrderDate),-1)))<=$(=YearEnd(Max(OrderDate),-1))"},Year=,Month=>} [values])

hope it will work,

regards

Rohit lohani

Highlighted
Contributor III
Contributor III

Re: Line Chart Current Year Vs Last Year

Hi,

In my app if current year Oct Nov values are zero then its not shows Trend on those Month

I have attached  QVW , pls check

Regards

Highlighted
Creator II
Creator II

Re: Line Chart Current Year Vs Last Year

if(sum({<Year={'$(Max(Year))'}>}values)=0,null(),sum({<Year={'$(Max(Year))'}>}values))  write this expression and in add on tab uncheck include zero value

View solution in original post

Highlighted
Creator
Creator

Re: Line Chart Current Year Vs Last Year

Hi Kulwant,

Thank You very much. It's works for me.

Thanks,

Rathnam.

Highlighted
Specialist III
Specialist III

Re: Line Chart Current Year Vs Last Year

Hi,

Attached Sample working apps,

maybe helpful to some others,

Thanks,

Mukram

Highlighted
Contributor
Contributor

Re: Line Chart Current Year Vs Last Year

Hi, I see the post is a bit old, but may I ask you how did you manage to put in the line graph both current and previous year lines? I am having troubles with finding the right formula to do this, it either shows me the current year and previous all zero or both is given the same value.

Here is what I'm using as formulas:

C.Y: sum({$ <  YearMonth={"<=$((Month(Today())))"}, Year={"<=$((Year(Today())))"}  >}[Orders])

L.Y : sum({$ <   YearMonth={"<=$(( YearMonthPrevious))"} >}[Orders])

Thanks in advance!