Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Problem in indirect set analysis

Hi all,

I have data like

 

RepItemSales
StellaIphone15000
ParkerIphone25000
MichealIphone25400
StellaSamsung14200
ParkerSamsung2300
MichealSamsung14500

and i want to to display the representative who has sell only Iphones, for that i had written set expression as below

sum({$<Rep=P({1<Item={'Iphone'}>}Rep)>}Sales);

This expression shows all the rows, but i want the output like

 

RepItemSales
StellaIphone15000
ParkerIphone25000
MichealIphone25400

Regards

Kalyan

8 Replies
sunny_talwar

May be try:

Sum({<Item = {'Iphone'}>}Sales)

sunny_talwar

Your expression -> sum({$<Rep=P({1<Item={'Iphone'}>}Rep)>}Sales)

is summing sales for all Reps who sell Iphone and since all of them sell Iphone you see them all.

nizamsha
Specialist II
Specialist II

Hi

While writing a condition for iphone u have to write item=iphone but u have written rep=iphone

sum({$<Item={'Iphone'}>}Sales)

or

=sum({$<Rep=p({$<Item={"IPhone"}>}Rep)>}Sales)

it will work

or

=sum({$<Rep=p({1<Item={"IPhone"}>}Rep)>}Sales)

MarcoWedel

Hi,

for salesmen who sold only iPhones, you could use:

=Sum({$<Rep={"=Only(Item)='iPhone'"}>} Sales)

QlikCommunity_Thread_186256_Pic1.JPG

QlikCommunity_Thread_186256_Pic2.JPG

hope this helps

regards

Marco

Not applicable
Author

Hi Ravuri

You can use one of either way

1- sum({<F2={'Iphone'}>}F3) as suggested by Sunny

or

2-if(F2='Iphone',sum(F3))

See attached for details.

Anonymous
Not applicable
Author

Hi,

I hope attached Application Helps you.

Thanks

Bunny

maxgro
MVP
MVP

another solution for salesmen who sold only iPhones (using Marco test data)

=Sum({$<Rep={"=count(distinct Item)=1"},Item={iPhone}>} Sales)

1.png

MarcoWedel

also possible:

=Sum({$<Rep-=p({$<Item={"=Item<>'iPhone'"}>} Rep)>} Sales)

regards

Marco