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

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
kunkumnaveen
Specialist
Specialist

multiple supplier expression

Hello,

          i want to display count of products  which is supplied by only  one supplier

                                                    

load * inline

[

product,supplier

A,XXX

A,YYY

A,ZZZ

B,HHH

B,LLL

C,OOO

L,PPP

];

expression:   =Count(Aggr(If(Count( distinct supplier) = 1,supplier),product))    so answer:2 which is correct

now for the same data i am trying to count  products which is supplied by multiple supplier

expression:     =Count(Aggr(If(Count( distinct supplier) >1,supplier),product))  so answer suppose to be 2 but i am geeting zero

can any help plz.

Thanks

1 Solution

Accepted Solutions
lironbaram
Partner - Master III
Partner - Master III

hi

use this function

=sum(Aggr(if(Count(distinct supplier)>1,1,0),product))

View solution in original post

6 Replies
prma7799
Master III
Master III

Like this ??

=Count(Aggr(If(Count( distinct supplier) > 0 ,supplier),product)) 

lironbaram
Partner - Master III
Partner - Master III

hi

use this function

=sum(Aggr(if(Count(distinct supplier)>1,1,0),product))

prma7799
Master III
Master III

Or you can try

=Count(Aggr(If(Count( distinct supplier) >=1 ,supplier),product)) 

kunkumnaveen
Specialist
Specialist
Author

Thanks for reply,

looks like greater then zero wont work because i need count of only those products which is supplied my multiple vendors or suppliers

prma7799
Master III
Master III

Try like this

=sum(Aggr(if(Count(distinct supplier)>1,1,0),product))

Anonymous
Not applicable

Hi,

Please see below.  I believe this will work.

=count(if(aggr(count(supplier),product)>1,product))