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

Announcements
Want to see what's currently in public preview? We've pulled it all together in one place. Check it out here
cancel
Showing results for 
Search instead for 
Did you mean: 
Clever_Anjos
Support
Support

Counting based on acumulated %

I have a base with similar to this where the first column is "customer name" for example

Dim4VV%V%aClass
i127025,18%5,18%1
z119174,86%10,04%1
k117424,79%14,82%1
t116574,75%19,58%1
j113904,64%24,22%1
v112224,58%28,80%1
q106264,33%33,13%2
w102264,17%37,30%2
p100854,11%41,41%2
c99264,05%45,46%2
m99044,04%49,50%2
l96803,95%53,44%3
h95333,89%57,33%3
e94933,87%61,20%3
x92723,78%64,98%3
o92213,76%68,74%3
g86013,51%72,25%3
s85763,50%75,74%3
r84563,45%79,19%3
d82783,38%82,56%4
{81833,34%85,90%4
b78873,22%89,12%4
n70922,89%92,01%4
u68372,79%94,80%4
f68112,78%97,57%4
y59542,43%100,00%4

I need to calculate a graph (not at load script) that shows

<30%6
30<x<505
50<x<808
>80%7

Where I am counting how many customers falls below acumulated 30%, how many falls between 30% and 50% and so on.

Any ideas?

Labels (1)
6 Replies
shree909
Partner - Specialist II
Partner - Specialist II

in the epressions u can write an if condition  and assign the

if (x <30,count(customers),

if(30<x<50 ,count(customers

..

try this

whiteline
Master II
Master II

Hi.

Your [V%a] and [class] columns, are they calculated in script or in chart ?

Clever_Anjos
Support
Support
Author

v%, v%a and Class are calculated at graph

v% = sum(Expression1)/sum(TOTAL Expression1)

v%a = RangeSum(above(Column(2),0,RowNo()))

and

class = if(column(3)<0.3,1,if(column(3)<0.5,2,if(column(3)<0.8,3,4))))

Clever_Anjos
Support
Support
Author

I need to develop another graph, that does not have Dim4 as a dimension.

whiteline
Master II
Master II

Hi.

You can create a chart with calculated dimension (used fractile as an example, rank() is also suitable):

aggr(

        if(Sum(V)>=fractile(total aggr(Sum(V), Dim4), 0.8), dual('<30%', 0),

          if(Sum(V)>=fractile(total aggr(Sum(V), Dim4), 0.6), dual('>=30%<50%', 0.3),

           if(Sum(V)>=fractile(total aggr(Sum(V), Dim4), 0.26), dual('>=50%<80%', 0.5), dual('>=80%', 0.8))))

, Dim4)

The problem is I don't know how to calculate fractile parameter dynamicaly according to your percent criteria

As for expresison use just =Count(Dim4)

Clever_Anjos
Support
Support
Author

I´ll try smething like this