Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Relative Values in Bar Chart

Hi Guys,

How can I show relative values against primary dimension in the Qlik Sense Bar Chart ?

About the Data

I have a very simple data set as shown below. I have also attached spreadsheet with this sample data.

table.PNG

Problem


I am using Rep & Product as Dimensions and =Num(sum(SaleAmount) / sum(TOTAL SalAmount),'0.0%') as measure.

But I get the following Chart.

reps.PNG

What I am trying to achieve?

I want to see every bar at 100% Level so I can compare relative share against each sales rep.

Right now when I filter data at a single Sales Rep level then I get the desire bar chart but it will only show one rep because I have applied filter.


I would like the below bar for all the reps.

100 percent.PNG

Thank you in advance

1 Solution

Accepted Solutions
sunny_talwar

You can set the axis to Max = 1

Capture.PNG

View solution in original post

19 Replies
sunny_talwar

Try this:

=Num(Sum(SaleAmount) / Sum(TOTAL <Rep> SalAmount),'0.0%')

Not applicable
Author

Thank you Sunny,

It Worked. But the Y axis now shows up to 150% !

worked.PNG

Could it be because some sales reps only have few products ?

sunny_talwar

You can set the axis to Max = 1

Capture.PNG

Not applicable
Author

Thanks sunny

Anonymous
Not applicable
Author

Hello!

Can this be done if instead of rep, I have a "drill down"?

Like Country/city

If I'm at the country level, the formulas will work if I use <Country> but when I zoom in the City level, the formula does not work anymore :S

Any idea?

sunny_talwar

See if Jonathan's response help you figure out the dimension

Re: QLIK SENSE: $(=GetCurrentField(Time))

If you are able to find the name of the dimension, you should be able to include that within <>.

Anonymous
Not applicable
Author

Hi,

Thanks a lot, that seems perfect!

Only problem I have is that my variable $vGetCurrentLocalisationFields seems to not be recognized in the expression as a field name:

$(vGetCurrentLocalisationFields) = country

aggr(Sum(quantity),country) does work but

aggr(Sum(quantity),$(vGetCurrentLocalisationFields)) does not....

sunny_talwar

You might need an equal sign

aggr(Sum(quantity),$(=vGetCurrentLocalisationFields))

Anonymous
Not applicable
Author

I've try taht but it did not work either