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

Product code missing in one of the branches

Hello!
I have a MySQL database, this bench I have the Products table, where I have a field that refers to the product code and another subsidiary of the investment, the 0006 is the stock, how can I do to show only the product code listed in 0006 and not included in other 5 branches?



Thanks

1 Solution

Accepted Solutions
anbu1984
Master III
Master III

Do you mean you want to list the products if atleast one of the store has no stock for a product and another store having stock more than for the same product? Then try this

T1:
Load * Inline [
Code,Shop,Amount
0525,0001,10
0525,0002,34
0525,0003,15
0464,0001,5
0464,0002,3
0464,0003,8
0876,0001,20
0876,0002,0
0876,0003,0 ]
;

Inner Join(T1)
Load Code Where Flag = 1;
Load Code,If(Min(Amount) = 0 And Max(Amount)>1,1,0) As Flag Resident T1 Group By Code;

View solution in original post

5 Replies
vvvvvvizard
Partner - Specialist
Partner - Specialist

load

product_table as whateva_name ,

field

from ...

try adding

where product_table=6;

anbu1984
Master III
Master III

Can you provide sample input and expected output?

Not applicable
Author

Hello!

I have a table with the product code, the store that the product and quantity.

Database:

Code Shop Amount

0525 0001 10
0525 0002 34
0525 0003 15

0464 0001 5
0464 0002 3
0464 0003 8
   
0876 0001 20
0876 0002 0
0876 0003 0

I wish that the output is only listed products that are cleared in a store and others are in balance over 1.

Code Shop Quantity

0876 0001 20
0876 0002 0
0876 0003 0



thank you

anbu1984
Master III
Master III

Do you mean you want to list the products if atleast one of the store has no stock for a product and another store having stock more than for the same product? Then try this

T1:
Load * Inline [
Code,Shop,Amount
0525,0001,10
0525,0002,34
0525,0003,15
0464,0001,5
0464,0002,3
0464,0003,8
0876,0001,20
0876,0002,0
0876,0003,0 ]
;

Inner Join(T1)
Load Code Where Flag = 1;
Load Code,If(Min(Amount) = 0 And Max(Amount)>1,1,0) As Flag Resident T1 Group By Code;

Not applicable
Author

Thanks Anbu, solved my problem.