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

Announcements
Join us to spark ideas for how to put the latest capabilities into action. Register here!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Categorise data into bar chart

Hi,

I have the following data structure ...

what i'm trying to do is, to create a 100% stacked bar chart,

and show the count of F1 which has more than 10 and lesser than 10.

have a look at the attached, i'm able to use some operator like F2 > 10, to create tha bar, but since it return -1 and 0 only. i'm not sure how to proceed further, can some one help?

Thanks,
Nick

F1F2
a6
a3
a12
a15
b1
b4
b3
b16
b17
c17
c4
c4


8 Replies
Not applicable
Author

Hi

It would be useful for me if you could include a picture of what you expect to see.

Not applicable
Author

OK, so I went ahead and put the attached together, not sure if this is what you want?

Not applicable
Author

Hi Nigel,

Exactly like the chart in the qvw i have attached, BUT, in 100% stacked bar chart. and without the -1 , 0 legend, this is because i 'm using operator in the DIMENSION.

i would prefer this to be solved by using if-else statement.

for now, i only know how to use simple operator to play around with it, but i'm sure there's other solution to it.

Thanks,
Nick

Not applicable
Author

Hi Nick

I took off the legend for the dummy dimension (this is needed to produce the stacked chart).

I took off the caption, thats optional but I tend not to use captions, preferring the title instead.

I set the maximum value of the Y-Axis to 1 (100%).

So, see attached for a better example.

Not applicable
Author

Hi Nigel,

We are almost there... 🙂

I need a , b , c to display as bar as well, and able to separate the count above and below 10.

for example, a ,b ,c represent different games, and F2, represent people's score,

so in the chart, i must be able to show, in game a, the ratio of above and below 10.. and so on..

Not applicable
Author

Hi Nick

How about the attached, I put two more examples in.

First should give 100% in total across A/B/C

Second obviously gives 100% for each of A/B/C

Not applicable
Author

Hi Nigel,

Yeah, that's what i need, but what does the 1 and 0 mean in the if (, ,1 ,0) ?

and why is it SUM ? shouldn't it be count?

i still need some times to get use to the synctax...

Thanks for helping....

Not applicable
Author

Hi Nick

That's just my personal preference because I can't get used to using the Count functions and I don't feel like I need to!!

So, the syntax is simply saying "Take a sum of: Where value is > 10 then 1 else 0" which means that each time it finds a row where the value is greater than 10, add 1 to the sum, otherwise add 0 to the sum.

As I say, its just my preference so it would be worth you spending a bit of time to convert it to counts which might be more obvious.