Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Bar chart with both monthly and annual amounts?

I have a bar chart with Month as dimension. My facts table contains data for 2016 and 2017 (with fields Year, Month and Amount). How can I in the same bar chart, show both Amounts per Month for a selected Year, and also the total Amount  for both 2016 and 2017?

1 Solution

Accepted Solutions
antoniotiman
Master III
Master III

Hi,

see Attachment.

Regards,

Antonio

View solution in original post

6 Replies
vvvvvvizard
Partner - Specialist
Partner - Specialist

Sum(amount) and sum(total amount) as second expression

antoniotiman
Master III
Master III

Hi,

see Attachment.

Regards,

Antonio

Anonymous
Not applicable
Author

Hi,

Thank you for your input for solving my problem! I will try to analyze it and see if I can understand the reasoning behind the advanced expression and the calculated dimension you used in your attached app.

arvind_patil
Partner - Specialist III
Partner - Specialist III

Hi Hans,

why you are not trying Drill down Object.

Thanks,

Arvind Patil

Anonymous
Not applicable
Author

Hi Antonio!

Thank you for suggesting using if-statements both for Dimension and Expression. I haven't yet figured out exactly how the Dual() functions works, I will give it some thought. But now, for my simplified approach below works fine.

So again, thank you for your support!

BR, Hans Kaminsky

Dimension (where field Dim = {1, 2016, 2017}

=if(Dim=1,Month,Dim)

Expression:

If(Dim=1,(Sum(Amount)),

If(Dim='2016', Sum({<Year={'2016'},Month=>} TOTAL Amount),

If(Dim='2017', Sum({<Year={'2017'},Month=>} TOTAL Amount))))

antoniotiman
Master III
Master III

Hi Hans,

I have used Dual() only to show

Regards,

Antonio