Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
datanibbler
Champion
Champion

Issue with a horizontal barchart


Hi,

I have an app that compares two sets of data - each with a sales amount calculated by a different party.

Logically, they are either equal (a case that is not of interest to me) or the one dataset has a greater sales_amount than the other.

To display those differences in different categories, I have a horizontal barchart with

- a rather complex calculated dimension mirroring the different reasons there can be for differences in the amount

- only one expression, that is >> sales_A - sales_B <<

The zero-bar is exactly in the middle. That is, in my eyes, the best and most intuitive way of displaying the differences there are in both directions.

One drawback which is intrinsic in this type of chart, however, is that bars extending to the right from the 0-bar display as positive and bars extending to the left display as negative.

Now I have been asked to enquire whether that can be changed - because it is not really correct: Those figures are not by nature negative.

Is there any way to tweak that barchart so that there are positive values on both sides of the 0-line?

Thanks a lot!

Best regards,

DataNibbler

4 Replies
marcus_sommer

Hi DataNibbler,

maybe you could display your data better within a straight-table in butterfly-mode - see here what I mean: Chart - Bevölkerungspyramide / populations pyramid‌ and I think you will find here more ideas: https://community.qlik.com/search.jspa?q=butterfly.

- Marcus

datanibbler
Champion
Champion
Author

Hi Marcus,

that population pyramid looks quite good.

Well, in fact, to me it looks pretty much the same, except that it doesn't have a scale and thus one doesn't see the "positive vs. negative" part.

I could do that by just not showing the scale. I have the exact figures displayed inside the elements anyway, so it isn't strictly necessary.

That % thing is pretty neat. I thought of having the % displayed yesterday, but that idea hasn't come to my mind yet. I'll try that.

I was pretty sure from the start that there would be no other way around the negative values because it is a mathematical constand that at the one side of a 0-line there are positive values and on the other there are negative values ...

I think I will go that way because I really cannot think of a more intuitive way to display that data. That way, it is immediately clear what kind of difference there is (dataset_A is bigger or smaller than dataset_B) and what is the largest chunk to go after in the subsequent analysis. I would necessarily lose one or the other of those advantages by making this into two different charts with only positive values.

The only drawback I still have to my approach is that even inside the segments the values of course display as negative, even without a scale.

So I might just have to try that other approach. The script to it looks pretty complicated and I cannot say that I fully understand it.

At the core of it is that chr(9608) which is just a coloured block - that is repeated n times and thus represents the values. But what part of it makes it go in both directions?

Is there a step-by-step explanation of how to build such a thing available here?

Thanks a lot!

marcus_sommer

Hi DataNibbler,

this playing with the ascii-code is rather a dirty trick - when I haven't really any idea to reach my goal - and in fact the chart should look more nicer as it did. Before that you should look if you could use charts within the straight-table as expression-interpretation. I have played with them and seen examples here but couldn't find them yet - but you could search for butterfly-charts.

- Marcus

datanibbler
Champion
Champion
Author

Thanks!

Well, dirty trick or not, it does look good, and that's what counts, no?

Never mind. I will see and ask if the people involved really deem it important enough to get rid of this rather little annoyance of having those values display as negative ... if they do, then I have no choice, but I will do the searching myself all right.

My problem right now is rather that none of the "stakeholders" of this really have a lot of time to discuss what I do and what the result should look like ... so I'll rather focus on the data and the functioning of the app for now and save such pure questions of design for later.

As I said, that "bars in both directions" thing is really the most intuitive and concise way of displaying that data that I can think of. That butterfly_thing does not display that minus_sign - well, it doesn't display the exact figures at all until you hover over a specific bar.

Well, for the moment I will put that aside. I'll think about it when I have talked to the "stakeholders" and they really, really want to see that minus_sign gone.

Best regards,

DataNibbler