Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
File_1 content:
Channel_Category | Order_category |
---|---|
DR | |
RT | |
WH | |
WH | PROJ |
WH | SPOR |
WH | SPPJ |
File_2 content:
Channel_string | Channel |
---|---|
DR|| | DE |
RT|| | RE |
WH|| | TR |
WH||PROJ | PRJ |
WH||SPOR | TR |
WH||SPPJ | PRJ |
Table_A:
Load Channel_Category,
Order_category,
Channel_Category&'||'&Order_Category as Channel_String
From File_1;
Left Join(Table_A)
Load Channel_String,
Channel
From File_2;
Then I display the table box of Table A is as below
Channel_Category | Order_category | Channel_String | Channel |
---|---|---|---|
DR | DR|| | - | |
RT | RT|| | - | |
WH | WH|| | - | |
WH | PROJ | WH||PROJ | PRJ |
WH | SPOR | WH||SPOR | TR |
WH | SPPJ | WH||SPPJ | PRJ |
Look at the table box, seems like the 'left join' for the first 3 records fails returns a valid value (yellow highlighted). Is this due to a 'blank' value in the load '&' statement? Or I am guessing that there is a invisible character in File_1 which causes the the failure, because there is no invisible characters in File_2 key field.
I am expecting the first 3 entry on the field 'Channel' returns 'DR', 'RE', 'TR'
Anyone shares light? Thanks.
Jack
use where LEN(TRIM(Order_Category)) <> 0
at the end of the load and that should get rid of the blanks.
The TRIM statement should remove leading and trailing blanks and then leave a length of zero.
I not understand clearly i get the below mention output from the script that i reply let me know.
See the output