Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
rathnam_qv
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
Anonymous
Not applicable

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
Anonymous
Not applicable

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

Anonymous
Not applicable

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

Anonymous
Not applicable

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

rathnam_qv
Creator
Creator
Author

Hi Kulwant,

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

Thanks,

Rathnam.

mdmukramali
Specialist III
Specialist III

Hi,

Attached Sample working apps,

maybe helpful to some others,

Thanks,

Mukram

Anonymous
Not applicable

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!