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

Announcements
ALERT: QlikView server communication interruptions following Microsoft Windows Domain Controller security updates
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Difficult with JOIN!

Hi everyone!

I have a problem and I will try to show.

I have one table with sales like that:

ProductColorOutletQuantityValueCost...
xxxxyyyyExample110,005,00

And I need to put, in that table a column with the stock. The table with stock is something like that:

ProductColorOutletStock(quantity)
xxxxyyyyExample10

To solve this problem I thought in:

1) I need a Key first, so I joined three columns  (Product + Color + Outlet) and I named "KEY".

2) I need to JOIN first table with the second table with OUTER JOIN. Because the results of the Join that I need is something like:

Product ColorOutletQuantityValueCostStock
xxxxyyyyExample110,005,0010
zzzzhhhhExample25
xxxxddddExample20

3) I need to show that stock in a Pivot Table in qlikview. But, I don't know how because, when I join the tables, some fields will be without value, so the problem is the filter.

Sorry because my english is poor. If someone have a Idea, I'm all ears and thank you for your attention!

Labels (1)
1 Solution

Accepted Solutions
Kushal_Chawda

Make sure that values on which you are joining having same values in both the tables.

SALES:

LOAD 

        capitalize(trim(Product)) as Product,

        capitalize(trim(Color)) as Color,

        capitalize(trim(Outlet)) as Outlet,

        Quantity,

        Value,

        Cost,

        ...                  

FROM

$(vStorePath)SALES.qvd (qvd)

WHERE( (DATE>=date#( '01/01/2015','DD/MM/YYYY') And DATE<= date#('01/01/2017','DD/MM/YYYY'))

;

OUTER JOIN(SALES)

STOCK:

LOAD

        capitalize(trim(Product)) as Product,

        capitalize(trim(Color)) as Color,

        capitalize(trim(Outlet)) as Outlet

         Stock

View solution in original post

6 Replies
sunny_talwar

Where did 2nd and 3rd row come from in your required output? Your data doesn't seem to show that information?

Anonymous
Not applicable
Author

use the left keep may be get the output

Kushal_Chawda

if you have Product + Color + Outlet as key then Just link the both tables on key , Qlikview will automatically do full outer join

Not applicable
Author

Hi Sunny, thanks for your attention, Again! So, I don't know exactly if I understood your question. The 2nd and 3rd row doesn't have information because(I guess that will be the result), the table with stock doesn't have information, so when I join, problably the result will be withou that information. I don't know if I answered the question.

Not applicable
Author

Hi kush!

I tried something like that:

SALES:

LOAD 

        Product,

        Color,

        Outlet,

        Quantity,

        Value,

        Cost,

        ...

                    

FROM

$(vStorePath)SALES.qvd (qvd)

WHERE( (DATE>= '01/01/2015' And DATE<= '01/01/2017'))

;

OUTER JOIN(SALES)

STOCK:

LOAD

    Product,

    Color,

    Outlet,

    Stock

And not work, so I created a key with(Product + Color + Outlet) and named KEY, to solve. But doens't work too.

Kushal_Chawda

Make sure that values on which you are joining having same values in both the tables.

SALES:

LOAD 

        capitalize(trim(Product)) as Product,

        capitalize(trim(Color)) as Color,

        capitalize(trim(Outlet)) as Outlet,

        Quantity,

        Value,

        Cost,

        ...                  

FROM

$(vStorePath)SALES.qvd (qvd)

WHERE( (DATE>=date#( '01/01/2015','DD/MM/YYYY') And DATE<= date#('01/01/2017','DD/MM/YYYY'))

;

OUTER JOIN(SALES)

STOCK:

LOAD

        capitalize(trim(Product)) as Product,

        capitalize(trim(Color)) as Color,

        capitalize(trim(Outlet)) as Outlet

         Stock