Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

I Want To Create the Bar Graph for Last Two Years Sales by category

Please find the below sample Data,

Order Id

Orderdate

Year

Category

SalesValue

1

8/10/2014

2014

Laptop

2000

1

8/10/2014

2014

Mobile Phone

5000

1

8/10/2014

2014

Monitor

500

1

8/10/2014

2014

TV

3000

2

8/11/2015

2015

Laptop

4000

2

8/11/2015

2015

Mobile Phone

10000

2

8/11/2015

2015

Monitor

1000

2

8/11/2015

2015

TV

6000

3

8/12/2016

2016

Laptop

2001

3

8/12/2016

2016

Mobile Phone

5001

3

8/12/2016

2016

Monitor

501

I want to Show the last two years sales is bar Graph for 2016 & 2015 based on category

I have used the Set Expression as :Sum({<Year={$(=Max(Year))}>}SalesValue) and Sum({<Year={$(=Max(Year)-1)}>}SalesValue)

but this expression is not working

Kindly help me out

Thanks in Advance!!

1 Solution

Accepted Solutions
MarcoWedel

Hi,

your expressions should work, here one example:

QlikCommunity_Thread_277985_Pic1.JPG

QlikCommunity_Thread_277985_Pic2.JPG

QlikCommunity_Thread_277985_Pic3.JPG

Another solution might be to add a Year dimension and use only one expression like this:

QlikCommunity_Thread_277985_Pic4.JPG

QlikCommunity_Thread_277985_Pic5.JPG

QlikCommunity_Thread_277985_Pic6.JPG

hope this helps

regards

Marco

View solution in original post

1 Reply
MarcoWedel

Hi,

your expressions should work, here one example:

QlikCommunity_Thread_277985_Pic1.JPG

QlikCommunity_Thread_277985_Pic2.JPG

QlikCommunity_Thread_277985_Pic3.JPG

Another solution might be to add a Year dimension and use only one expression like this:

QlikCommunity_Thread_277985_Pic4.JPG

QlikCommunity_Thread_277985_Pic5.JPG

QlikCommunity_Thread_277985_Pic6.JPG

hope this helps

regards

Marco