Skip to main content
Announcements
Live today at 11 AM ET. Get your questions about Qlik Connect answered, or just listen in. SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Compare YoY Sales in the same line graph

Hi everyone,


I want to see a simple line graph that shows a line for FY14 sales and a separate line for FY15 sales on the same line graph.  Data is ordered sequentially and example graph below.   I've read a few forums with very complicated suggestions for complicated datasets, but mine is simple - 2 cuts of the same dataset.    I assume I create an Expression with a formula  (e.g. Sales  where Year = 2014) and another Expression ( Sales  where Year = 2015), so what's the syntax to show only a limited selection of the same data ?

 

YearMonthSales
2014January65%
2014February72%
2014March66%
2014April50%
2014May60%
2015January70%
2015February73%
2015March80%
2015April70%
2015May65%

Untitled.png

And second question is - how do I then add a singular line that represents the target ?  So if Target is 80% across the year, can I do this another way that doesn't involve adding it line by line in to the source data ?

Thanks,

Dave

1 Solution

Accepted Solutions
Not applicable
Author

Hi,

In the expression use this formula

=sum({<Year={'2014'}>}Sales)  for the YOY for 2014

=sum({<Year={'2015'}>}Sales) for YOY for 2015

View solution in original post

5 Replies
Not applicable
Author

Hi,

In the expression use this formula

=sum({<Year={'2014'}>}Sales)  for the YOY for 2014

=sum({<Year={'2015'}>}Sales) for YOY for 2015

sasiparupudi1
Master III
Master III

try

sum({<Year={2015}>} Sales)

sum({<Year={2014}>} Sales)

gautik92
Specialist III
Specialist III

create a variable lik

vYear= max(Year)-1

then create a input box with variable vYear

create chart with expressions

sum({$<Year={$(=Max(Year))}>} Sales)

sum({$<Year={$(=Max(Year)-vYear)}>} Sales)


you can compare 2015 with 2014 and also with more previous years by changing values in input box

Anonymous
Not applicable
Author

Thanks everyone - I especially like the input box variable idea.

I've also just worked out how simple my second question is to answer 🙂

A third Expression with =80%

Anonymous
Not applicable
Author

For your second question, you could also just add a Reference Line on the bottom right of the Presentation tab.

Reference Line.PNG