Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Want to see what's currently in public preview? We've pulled it all together in one place. Check it out here
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Calculating Relative % values for each X axis values

I have my Primary Dimension as Year and Product Category as my Secondary Dimension.

While calculating Sales %, I usually use Sum(Sales) with Relative option checked. If I do that, I get something like the below chart

1.JPG

Here, the expression takes into account the values of all the 6 bars and then calculate a value. However, I need to get the relative split for each year. Something like this

2.JPG

The above image has 2 Charts, one for 2014 and 2015. Is there a way to do it in a single chart?

Note: I don't want to use two expression in a single chart, because I want to make use of the Dimension selection option that is available by default and I have used this expression as Sum({1}Sales) since I have to highlight the selected Bar Chart and gray out the non selected something like this

3.JPG

Even though these are all work around's for a particular problem. I'm curious enough to know Is it possible to implement all the above features in a single bar chart?

Labels (1)
1 Solution

Accepted Solutions
vicky_qv
Contributor III
Contributor III

Hi,

In expression, just give sum(Sales)/sum(TOTAL<year>Sales.

Thanks,

Vignesh U.

View solution in original post

5 Replies
Chanty4u
MVP
MVP

did u chkd option for all expressions?

relative

Anonymous
Not applicable
Author

I just have a single expression. The three bars represent Secondary Dimension values. And, Yes. I checked the relative option

Not applicable
Author

Try with

sum(Sales)/sum(Total <Year> Sales)

It should give you percentages per year

vicky_qv
Contributor III
Contributor III

Hi,

In expression, just give sum(Sales)/sum(TOTAL<year>Sales.

Thanks,

Vignesh U.

vicky_qv
Contributor III
Contributor III

And dont check the Relative checkbox in expression.