Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
QS21
Creator
Creator

Show current yr and last yr value on the same bar

Hi all,

I need to create a bar chart on which I will have months Jan to Dec on X axis like this:

Jan, Feb, Mar,......., Dec

As for measures, I have Balance which I need to show as two bars. For example, on Jan, I will have two bars one will show curr year balance and other will show last year balance.

Please help me with how to achieve this in qliksense..

Thanks!

 

5 Replies
chris_djih
Creator III
Creator III

have a look at @Patric_Nordstrom's christmas special:

https://community.qlik.com/t5/Qlik-Sense-Documents/24-days-of-Visualization/ta-p/1875069

i think the 2nd sheet (3 possible ways to do it) is what you need:

prevyear.png

If you found help, mark the correct answer and give some likes to ALL contributors, that tried to help.
QS21
Creator
Creator
Author

Hi @chris_djih ,

I tried opening the link but I coulnot find the article that you mentioned.. and yes, I am looking for something like above.. Request if you could post the same solution here. Many thanks in advance!

chris_djih
Creator III
Creator III

You saw this image on the link?
grafik.png

Then you were on the right article, just scroll down and there you can find an example app and the explanation in the attachements:
grafik.png

There it is exactly described how to solve this in pages 4-9...

If you found help, mark the correct answer and give some likes to ALL contributors, that tried to help.
QS21
Creator
Creator
Author

Hi Chris,

 

I have tried and achieved the same. I needed a bar chart with axis showing months Jan, Feb etc and on Jan I will show two bars one for curr mth and other for last mth. I was able to achieve this by using date o  dimensions and year on dimension2. 

Now the problem is I need to bring another chart same one but need to show YTDs. I have been trying for two days and there is no luck. I have used 

If(num(month(date#(mydate,'mmmm')))<=num(month(date(mydate2))),

Rangesum(above((sum({<desc='www'}>}balance)/xrate),0,rowno()))/1000)

 

 

Pls help!

chris_djih
Creator III
Creator III

I would recomment to add a field in your calender script (if exists), or at least a new date field that makes selection for YTD a lot more easier:

Load *,
	IF(NUM(NUM(Month(DateField),'00') & NUM(Day(DateField),'00')) <= NUM(Month(today()),'00') & NUM(Day(today()),'00'),1,0) AS Date_YTD
resident table;

then you can add this field into a set-analysis: {<Date_YTD={1}>}.

If you found help, mark the correct answer and give some likes to ALL contributors, that tried to help.