Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Alternate State Issue

Hi,

Need your help.

I have the following table:

 

KarthickMuthuCAR100
VeniThangamTV200
SudheepSuthanTOY300
AnandMuthuSHOE400
SuriyaThangamCAR500
GaneshSuthanTV600
KarthickMuthuTOY700
VeniThangamSHOE800
SudheepSuthanCAR900
AnandMuthuTV1000
SuriyaThangamTOY1100
GaneshSuthanSHOE1200

Also, i have the following expression:

=sum( {$<Customer = P({<Product={'CAR'}>}Supplier)>}Sales). But I am getting a value of zero for this. Why I am getting zero for this?

My expectation is 7800 (because CAR is associated with Three Suppliers (Muthu,Thangam and Suthan and those suppliers are associated to all the Customers)

Thanks,

Karthick S

20 Replies
mayankraoka
Specialist
Specialist

Can you share the sample app?

Regards,

Mayank

mayankraoka
Specialist
Specialist

Try this one.

sum( {$<Customer = P({<Product={'CAR'}>}Customer)>}Sales).

antoniotiman
Master III
Master III

Hi,

try

sum( {$<Supplier = P({<Product={'CAR'}>}Supplier)>}Sales)

Anonymous
Not applicable
Author

Also, i have the following expression:

=sum( {$<Customer = P({<Product={'CAR'}>}Supplier)>}Sales). But I am getting a value of zero for this. Why I am getting zero for this?

You are comparing Customer with Supplier, how this will work??

sunny_talwar

I would just do like this:

=Sum({$<Supplier = P({<Product={'CAR'}>})>}Sales)

Anonymous
Not applicable
Author

Hi Karthick:

Try this expression

=sum( {$<Customer = P({<Supplier = P({<Product={'CAR'}>}Supplier)>}Customer)>}Sales)

It calculates the suppliers that have sold CAR product, and the customers that have purchased to the Suppliers who have sold a car.

Regards!

Anonymous
Not applicable
Author

Hi karthick01

Please try this.

=Sum( {$<Supplier = P({<Product={'CAR'}>}Supplier)>}Sales )

Anonymous
Not applicable
Author

Hi Balraj,

I have taken the below expression from Qlikview reference manual:

sum( {$<Customer = P({1<Product={'Shoe'}>} Supplier)>}

Sales ) and the explanation is:

returns the sales for current selection, but only those customers

that ever have supplied the product ‘Shoe’. The ele372

ment function P( ) here returns a list of possible suppliers;

those that are implied by the selection ‘Shoe’ in the field

Product. The list of suppliers is then used as a selection in

the field Customer.

I am trying to execute the same thing. How does this work then?

Anonymous
Not applicable
Author

Sunny,

I have taken the below expression from Qlikview reference manual:

sum( {$<Customer = P({1<Product={'Shoe'}>} Supplier)>}

Sales ) and the explanation is:

returns the sales for current selection, but only those customers

that ever have supplied the product ‘Shoe’. The ele372

ment function P( ) here returns a list of possible suppliers;

those that are implied by the selection ‘Shoe’ in the field

Product. The list of suppliers is then used as a selection in

the field Customer.

I am trying to execute the same thing and thats why I am not understanding why I am getting 0.