Qlik Community

QlikView Layout & Visualizations

Discussion Board for collaboration on QlikView Layout & Visualizations.

Highlighted
Not applicable

Percentage Value on Data Point - Stacked Bar chart

In the attached sample doc, I'm using a stacked bar chart to show counts of customers with positive vs negative sales.  Customers with positive sales show above the 0 mark and companies with negative sales show below.  I also want to show the % of total customers per month in the 'positive' above each month's bar.  I added a 3rd expression to do this, but the value I'm getting is the count of the positive customers plus 1 (is it adding the percentage value to the count and rounding?? if so why??).  However, in the pop-up text, i'm getting the correct percentage value.

Can anyone help me figure out how to get the accurate percentage to show on the chart?

P.S. I have been able to get closer to what i want, but then it was showing the same (positive) !percentage above and below.  I want either the corresponding percentage above/below, or just the positive percentage (since the inverse can be inferred)

8 Replies
kawamuram
Contributor II

Re: Percentage Value on Data Point - Stacked Bar chart

Hi Ashley,

I tried to solve your problems, but I don't know if I understand all of them.

About the plus 1 customer that is missing, is because the expressions are GrossSales = {'>0'} or GrossSales = {'<0'}, so the GrossSales = 0 are not counting.

Also, I guess is not possible to put the value and '% 'above the bars, so I put the '% 'above and the value in the axis.

Best Regards

Not applicable

Re: Percentage Value on Data Point - Stacked Bar chart

Thanks, but i'm not trying to have both.  I just want the percentage above the bar and it always comes out as the actual count value +1 instead of percent of the total.  It's ok to exclude those with 0 sales because i'm only looking at those with positive or negative sales.

kawamuram
Contributor II

Re: Percentage Value on Data Point - Stacked Bar chart

Hi,

I don't know if is possible above the bar, but I put in the middle.

I didn't understand the second part "always comes out as the actual count value +1 instead of percent of the total"? The percentage is okay, isn't it?

Best Regards

sun_dip08
New Contributor III

Re: Percentage Value on Data Point - Stacked Bar chart

Right Mauri. Not sure if we can plot expression data point on the top of the bar and expression you put looks promising.

MVP
MVP

Re: Percentage Value on Data Point - Stacked Bar chart

Maybe like attached?

You said the invese can be inferred, but I think your current calculation misses the case GrossSales = 0. That's why the sum of Met and not met will not add up to 100%.

NickHoff
Valued Contributor

Re: Percentage Value on Data Point - Stacked Bar chart

Try count address number/count(total address number) with all options for the chart deselected except for show value on data points.

Re: Percentage Value on Data Point - Stacked Bar chart

Hi,

another solution maybe could be to replace the text representation of the first expression with the percentage value using the dual() function:

QlikCommunity_Thread_178352_Pic1.JPG

QlikCommunity_Thread_178352_Pic2.JPG

hope this helps

regards

Marco

Not applicable

Re: Percentage Value on Data Point - Stacked Bar chart

ok, so this works, but why does it only work if you 'plot values inside segments', but give a different value when you don't check that box and let the values display above the bars?