Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Count function

Hello,

I am an new member and I would like to set an expression with a count function.

I have a data :

NameCategorySubcategoryP131P232
AZZZOther60,005,00352
BZZZOther 170,00532,002565
CXXXOther80,005,00345
DXXXOther 190,0035,009035
EZZZOther363,005,002535
FXXXOther60,005,00352
GZZZOther 170,00532,002565
HXXXOther80,005,00345
IZZZOther 190,0035,009035
JXXXOther363,005,002535

I would like to count a number of names which will be restricted by category 'XXX' and (P1+31 - P2 - 32) >0

I also attached QV for support

Another issue I have is count how many largest 'name' will make 80% (P1+31)  for subcategory.

If someone could help I will be grateful .

Many thanks in advance

1 Solution

Accepted Solutions
Not applicable
Author

Hi,

Check if attached expression works for you.

And your second requirement should be possible using teh approach that Nicole mentioned in her reply.

Rgds,

SK

View solution in original post

4 Replies
Nicole-Smith

sanchopancho wrote:

I would like to count a number of names which will be restricted by category 'XXX' and (P1+31 - P2 - 32) >0

Your expression should be:

Count({$<Name={'=[31]+[P1]-[32]-[P2]>0'},Category ={'XXX'}>} Name)

sanchopancho wrote:

Another issue I have is count how many largest 'name' will make 80% (P1+31)  for subcategory.

See this document: http://community.qlik.com/blogs/qlikviewdesignblog/2013/12/09/pareto-analysis

Not applicable
Author

Hi Nicole,

Thanks for your reply.

Nicole Smith wrote:

Your expression should be:

Count({$<Name={'=[31]+[P1]-[32]-[P2]>0'},Category ={'XXX'}>} Name)

I tried it and I have an "error in set modifier ad hoc element list" in my expression .

Also there is a red mark under ]-[ between second subtraction.

Do you have any idea why ?

Not applicable
Author

Hi,

Check if attached expression works for you.

And your second requirement should be possible using teh approach that Nicole mentioned in her reply.

Rgds,

SK

Not applicable
Author

Thanks very much .

It works for me