Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Dear Qlikview community,
I have a table from which I selected product where type of product (TYPEART in the enclosed code file: Join 2 parts of the same Table code.rtf) is equal to 'P' and I did a join with the same part of the Table where type of product is equal to 'M' this time.
When I displayed all fields of the resulting table I found that some fields corresponding to the type of product equal to 'M' aren't displayed. (These fields are CODUSN, CODEMP, CODSMP and TYPEART on which I did the test using where clause: please see Fields without values file.doc)
Could you please point to what I did wrong.
Note: Enclosed the Qlikview code and The Qlikview results table.
Thank you very much in advance,
Kind results,
Abdallah
hello
that measn that you have rows of type P which don't match rows of type M
Qlik uses alls the keys of same name to match the lines
and you use an outer join
maybe you need to use another join depending on your needs
Hi Abdallah, none of the records will join with the other table: the join is did between fields with the same name, TYPEART is in both tables, and forced to be a distinct value, so never will found a value to join in the other table.
Try renaming the fields you don't want to use in join in one of the tables.
Take a look at the help to check some simple examples of how it works:
I proceeded this way because I have only one lookup table of the codes of the products.
So, in the fact table (transfers) I have to point the product code either to (CODEMP, CODESMP) or (CODPROD, CODSPROD) depending on typeart field, but I need the result in the same table because in case I use 2 tables circular loops are generated.
Hi Ruben,
The only other fields that can be distinct are CODEMP, CODESMP, CODPROD and CODSPROD in addition to typeart, but I want them like that.
The purpose of this is because I have to point the product code to either (CODEMP and CODESMP) or (CODPROD and CODSPROD).
I tried to keep the result in two sepearted tables but circular loops were generated, so I don't know how to proceed.
Join is when you want to add fields to a table to add row information, in that case you need to identify the key to do the join, the firelds that you don't want in the key has to be renamed to be different in both table.
Maybe you want to concatenate, not to join:
Table1:
LOAD...
FROM...Table1Source;
Concatenate (Table1)
LOAD...
FROM...Table2Source;
I renamed some fields but the fields I kept are CODUSN, CODUSNSRC_DST, NATIO, ..., and TYPEART. I want these fields to remain in each and in the final table.
Just I want to add that these to table I want to join are originaly from the same table. I seperated them in order to point 2 fields in the original table to the right fields in a lookup table. So I want these 4 new fields to be added to the last joint table.
These 4 new fields are CODMP, CODSMP, CODPROD and CODSPROD instead of CODART and CODESART.
I will try concatenate to if there's no other solution.
Thank you
With TYPEART it wont join, only rows with the same values in all fields will join. One table has the value 'P' for all rows and other table has the value 'M' for all rows, so there will be no coincidence in any row between these two tables.
Still I don't know what are you trying to do at the end, why you need to join tables like or if there will be any other possibilities, but try concatenating, it solves many problems with circular references.
Hi Ruben,
What I know is that we use JOIN when we want to add a columns to an existing table. Concatenate is used when we add rows that means we have the same columns names.
In my case I have columns in common but there are also new columns.
When I used JOIN I don't want all fields to join on the same rows, but to get the information I want on different rows and columns.
I have a question if I rename a field base on a selection on an other field using WHERE does the new name apply also when the WHERE condition is not met?
Kind regards,
Abdallah