Skip to main content
Announcements
Introducing a new Enhanced File Management feature in Qlik Cloud! GET THE DETAILS!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

How to show max bar on bar chart?

I am trying to show only the max bar of my bar chart but I am struggling loads. I am using the expression:

sum( If(Program <> 'DETECT STOP', DowntimeDuration))

From this equation, I would need to display only the highest "DowntimeDuration" bar on the actual bar chart, how do I do this? I have tried things like max(sum( If(Program <> 'DETECT STOP', DowntimeDuration))) but that definitely does not work. I obviously have no idea what I am doing.

Program is the name of a list and DETECT STOP is just one variable that is excluded form that list and then the DowntimeDuration is the y-axis.

1 Solution

Accepted Solutions
jerem1234
Specialist II
Specialist II

Uncheck Show Others at the bottom of the dimension limits tab:

Others.PNG.png

Hope this helps!

View solution in original post

10 Replies
Not applicable
Author

Hey Suvi,

My suggestion would be to use a calculated dimension such that only the dimension which has the maximum expression value is displayed.

If you have QV11 you can use Dimension limits.

Thanks

AJ

jerem1234
Specialist II
Specialist II

Use dimension limits on your dimension to only show largest value:

Max Bar.PNG.png

But make sure Others is unchecked.

Hope this helps!

MK_QSL
MVP
MVP

Use Calculated Dimension as if you want DowntimeDuration as Dimension

MAX(Aggr(sum( If(Program <> 'DETECT STOP', DowntimeDuration)),DowntimeDuration))


and Expression is same

Not applicable
Author

Thanks AJ,

I tried doing it that way, although now it only gives me the full total Duration time rather than the maximum and the labels are wrong. I think it needs to be done through the expressions. Do you know of an equation for how it could be done?

Not applicable
Author

Hmm, the dimension limits kind of help, oddly though, the actual highest one is at number two, and number one is just the total of all of them. Strange.

Still trying yours Manish.

MK_QSL
MVP
MVP

Create a Bar Chart

Add Calculated Dimension as below..

=AGGR(IF(RANK(SUM({<Program= {'DETECT STOP'}>}DowntimeDuration))=1,YourRequiredDimension),YourRequiredDimension)

Tick Supress When Value is NULL

Expression = SUM({<Program= {'DETECT STOP'}>}DowntimeDuration)

Hope This Help..

YourRequiredDimension = Program in your case

jerem1234
Specialist II
Specialist II

Uncheck Show Others at the bottom of the dimension limits tab:

Others.PNG.png

Hope this helps!

jerem1234
Specialist II
Specialist II

If you have "Show Total" checked, also uncheck that.

Not applicable
Author

GOT IT! You are a genius! Thank you everyone so much! Very helpful.