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: 
aniketsr
Creator
Creator

Help in grouped bar chart

Hi ,

I have a requirement as per the attached format, in this format we have two dimensions  country and business.

and along with that we have two expressions one is a negative value and other is positive value

I have used bar chart with two dimensions and when i use only one expression we get the color of the bar according to the country, but later when i put the second expression we get the bar color as per the expressions..

i need guidance on how can i use two expressions  and two dimensions and the color of the bar should be based on the one dimenision which is country dimension.

attached is the image for reference.

Thanks in advance..

13 Replies
Gysbert_Wassenaar

perhaps: rangesum(sum({ <status={`buy`}> }sales), sum({ <status={`sell`}> }sales)*-1)


talk is cheap, supply exceeds demand
aniketsr
Creator
Creator
Author

Hi Gysbert,

I used the expression above it is working fine iam getting the Desired view ,

But when i deep dive into selection due to rangesum  suppose Buy is 1 MM and Sell is -6 MM the in the out put we get -5 can i get some guidance on the same.

Gysbert_Wassenaar

1 - 6 = -5 afaik. So, what's the problem?


talk is cheap, supply exceeds demand
aniketsr
Creator
Creator
Author

According to  the requirement we wanted to have one expression for buy and sell wherein , the BUY bar should be in the positive end of the bar chart and SELL should be on the negative side.

Now suppose for a specific date , buy was 1 and sell was -6 then for that particular date there shall be two bars one at the positive side and the other on the negative side , but now because of rangesum it is summing the two values and as the output is in negative then the bar is showing at the negative end.

please guide me if we can keep the values static for a specific date