Skip to main content
Announcements
Global Transformation Awards! Applications are now open. Submit Entry
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Bar Chart error using count(total ..) and relative Dimension Limits

Hello,

I am working on a highly dynamic application and now there is a problem using relative numbers in combination with dimension limits.

The reduced application is in the attachment. It has a table of two columns (ym and group) and a table to switch between absolute and relative values. The bar chart is the challenging part.

For the graph I use ym for the x-axis and stack the columns by the second dimension group. The expression uses the second table to show either absolute or relative values and looks like the following:

if(absrel='relative',

    count(group)/Count(TOTAL<ym>group),

    count(group))

   

The problem can be seen best in 0216: There are 7 values with 4(57%) in group a, 2(29%) in group b and 1(14%) in group c. Each value of the first expression in a group being smaller than '30%' relative to the total shall be summed up as 'others' as done in Dimension Limits. Using absolute values everything works as expected:

ok.PNG

But switching to relative there are no 'others':

nok0.PNG

Setting the smaller than value to '40%' makes it even more confusing since a is clearly over 50%:

nok1.PNG

It looks like the TOTAL part causes that behaviour but I'm not sure how to help it.

FYI: I'm using QV12 SR0. The changelog of SR1 is addressing an issue with "Show only values that accumulates to" but that shouldn't take place in this example. I also noticed the same behaviour on the Server running 11.20.

Thanks in advance for any help.

2 Replies
sunny_talwar

I don't fully understand the issue, but from what I understand here is that there is a QlikView's way of calculating relative which is equivalent of this -> Count()/Count(TOTAL ...) vs. your relative Count()/Count(TOTAL <Field> ... )

These two are very different things. If you change your expression to this ->

if(absrel='relative',  count(group)/Count(TOTAL group),  count(group))

my guess is that you won't see any differences.

Not applicable
Author

Hello, thanks for the answer.

Removing the <Field> of total does make an unwanted difference since I want to see the count of a group in relation to every group available in a certain ym (like 0216 to stick to the example). Leaving the <Field> as in Count(TOTAL group) results in 11 - the amount of all group entries in the table and not in 7 as in the amount of all group entries for 0216.

In fact my expression yields values of [0,1] for a group. No matter how many groups available they always sum up to exactly 1.0 for a specific month.

The relative values for 0216 are a:0.57, b:0.29, c:0.14. Entering "30%" in Dimension Limits should put b and c in 'others' together which it does not as seen in picture 2. Could there be a problem with the "30%" format?