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: 
Not applicable

Total sum Customer1=Customer2

Don't know how do to this. I want total Qty where Customer1=Customer2

Try sum({1} total <[Customer1]>=[Customer2]> Qty) but don't work

Thanks very much


[Table1]:
LOAD * INLINE [
Customer1, Prd, CA
001, A, 10
001, B, 20
002, A, 40
003, C, 100
];

[Table2]:
OUTER JOIN (Table1) LOAD * INLINE [
Prd, Qty, Customer2
A, 1, 001
B, 1, 002
C, 1, 003
D, 1, 001
E, 1, 001
];

error loading image

1 Solution

Accepted Solutions
martin59
Specialist II
Specialist II

Hello,

You can try this :

count(Distinct if(Customer1=Customer2,Prd))


View solution in original post

8 Replies
Not applicable
Author

Hi

You expect then that Table2 entries without a corresponding Table1 entry will get Customer1 field set to Customer2 value?

Or summarise also when Customer1 is null?

Juerg

Not applicable
Author

Hi

Table 1 and Table 2 always correspond on field "prd"

thanks

Not applicable
Author

SomeBody to help me ?

Thank you very much

Not applicable
Author

Hi

You need to explain why you would expect the number 3 to show as your table has only 2 entries for Customer1 = 001.

You will get 3 for sum({1} TOTAL <Customer2> Qty)

And the {1} will ignore any selections you make - is this your intention?

Juerg

Not applicable
Author

Sorry, Here is a better exemple (Hope)

Thanks

[Table1]:
LOAD * INLINE [
Customer1, Prd, CA
001, A, 10
001, B, 20
002, A, 40
003, C, 100
001, A, 25
001, A, 45
];

[Table2]:
OUTER JOIN (Table1) LOAD * INLINE [
Prd, Customer2
A, 001
B, 002
C, 003
D, 001
E, 001
];

martin59
Specialist II
Specialist II

Hello,

You can try this :

count(Distinct if(Customer1=Customer2,Prd))


martin59
Specialist II
Specialist II

Here is my result :

Not applicable
Author

This is exactly what i want. Thank you very much