Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
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..

1 Solution

Accepted Solutions
Gysbert_Wassenaar

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


talk is cheap, supply exceeds demand

View solution in original post

13 Replies
vishsaggi
Champion III
Champion III

Can you share a sample to look into?

Gysbert_Wassenaar

A bar chart can have two dimensions and one expression or it can have one dimension and lots of expressions. The combination of two dimensions and two expressions is not possible. But perhaps you can turn your two expressions into one expression that returns a positive or negative values as necessary.


talk is cheap, supply exceeds demand
aniketsr
Creator
Creator
Author

Hi Gysbert,

Thank you for the information

Need some guidance on how and  what will be the best way to implement a chart as per the attached image.

vishsaggi
Champion III
Champion III

You may want to use cyclic dimensions and two expressions and you can switch dimensions accordingly. Can you share a sample or output based on what Gysbert advised?

aniketsr
Creator
Creator
Author

Hi ,

I have two simple expressions

Expr1= sum({ <status={`buy`}> }sales)

Expr2= sum({ <status={`sell`}> }sales)*-1


Can you please guide how can I convert these expressions in one.


Thanks


vishsaggi
Champion III
Champion III

May be this?

= Sum({<status = {'buy', 'sell'} >}sales) *-1

aniketsr
Creator
Creator
Author

In this expression we are multiplying both the sell and buy with (-1)

aniketsr
Creator
Creator
Author

for sell it should be multiplied by 1 and for buy the expression should be multiplied by -1

aniketsr
Creator
Creator
Author

Hi  Gysbert,

I have two simple expressions

Expr1= sum({ <status={`buy`}> }sales)

Expr2= sum({ <status={`sell`}> }sales)*-1


Can you please guide how can I merge these expressions in one.

for sell it should be multiplied by -1 and for buy the expression should be multiplied by 1

Thanks