Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
I have using the following code and 'ChnlCode' column is loaded along with two other columns and I only expect it will only contain two column: [%Territory Key],Flag
[BC]:
Load
[%Territory Key],
if (ChnlCode=6,'DCIO',if(Match(ChnlCode,'1', '11', '12', '2'),'BC')) as Flag;
Load [%Territory Key],
[Channel Code] as ChnlCode,
[Wholesaler Full Name]
Resident [Dim Territory];
left Join
Load [Channel Code] as ChnlCode
Resident [Dim Channel]
where match([Channel Code],'1', '11', '12', '2','6');
Please suggest what is wrong here?
May be use this?
[BC]:
Load
[%Territory Key],
if (ChnlCode=6,'DCIO',if(Match(ChnlCode,'1', '11', '12', '2'),'BC')) as Flag;
Load [%Territory Key],
[Channel Code] as ChnlCode,
[Wholesaler Full Name]
Resident [Dim Territory];
[Dim]:
Load [Channel Code] as ChnlCode
Resident [Dim Channel]
left Join ([BC])
Load ChnlCode
Resident [Dim]
where match(ChnlCode,'1', '11', '12', '2','6');
can you explain clearly what is your current output and the expected output?
Are you getting any error messages?
Where are you Left Joining this into? BC? But BC doesn't even have ChnlCode anymore?
left Join
Load [Channel Code] as ChnlCode
Resident [Dim Channel]
where match([Channel Code],'1', '11', '12', '2','6');
You are basically creating a Cartesian Join
BC Left JOIN table2
[%Territory Key] ChnlCode
Flag
So each row of BC will be joined with each row of table2
[BC]:
Load
[%Territory Key],
if (ChnlCode=6,'DCIO',if(Match(ChnlCode,'1', '11', '12', '2'),'BC')) as Flag;
Load [%Territory Key],
[Channel Code] as ChnlCode,
[Wholesaler Full Name]
Resident [Dim Territory];
left Join
Load [Channel Code] as ChnlCode
Resident [Dim Channel]
where match([Channel Code],'1', '11', '12', '2','6');
hi,
Basically I want to join 'Dim Territory' table with [Dim Channel] , based on [Channel Code] column and want to load
[%Territory Key],Flag columns only for whole set of data.
So I am using:
[BC]:
Load
[%Territory Key],
if([Channel Code]=6,'DCIO',if(Match([Channel Code],'1', '11', '12', '2'),'BC')) as Flag;
Load [%Territory Key],
[Channel Code],
[Wholesaler Full Name]
Resident [Dim Territory];
left Join
Load
if([Channel Code]=6,'DCIO',if(Match([Channel Code],'1', '11', '12', '2'),'BC')) as Flag;
Load [Channel Code]
Resident [Dim Channel];
code. But when I choose [Channel Code] as filter from the drop down, wring result is showing.
sorry buddy you post still doesn't give any clarity on what you are trying to do with the JOIN
Can you post a sample
Preparing examples for Upload - Reduction and Data Scrambling
Qlik Community Tip: How to Get Answers to Your Post
100% agree with Vineeth... no idea what you are doing and what is going wrong when you select Channel Code
Hi,
I am using the following code to join two tables: 'Dim Territory' table with [Dim Channel] , based on [Channel Code] column and want to load only [%Territory Key] and FLAG column in the BC table, as I only use two columns in the preceding load. But when I load the data it loads three columns: [%Territory Key] , FLAG and [Channel Code] in the BC table.
So how can I overcome this situation? means how to only load two column?
[BC]:
Load
[%Territory Key],
if([Channel Code]=6,'DCIO',if(Match([Channel Code],'1', '11', '12', '2'),'BC')) as Flag;
Load
[Channel Code],
[Wholesaler Full Name]
Resident [Dim Territory];
left Join
Load [Channel Code]
Resident [Dim Channel];
'Dim Territory' table with [Dim Channel] , based on [Channel Code]
Assuming you only want to keep those [%Territory Key] which exist in field [Channel Code]
You should be using RIGHT KEEP instead of Left JOIN!!
try below
[BC]:
Load
[%Territory Key],
if([Channel Code]=6,'DCIO',if(Match([Channel Code],'1', '11', '12', '2'),'BC')) as Flag;
Load
[Channel Code],
[Wholesaler Full Name]
Resident [Dim Territory];
RIGHT KEEP
temp:
Load [Channel Code] as [%Territory Key],
Resident [Dim Channel];
Drop table temp;