Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
This is something I have searched a lot in Qlikview. Haven't found any solution for this.
Say, I have 2 Tables with the following Data
A:
Key | Value |
---|---|
10 | 150 |
11 | 100 |
B:
Key | Value |
---|---|
10 | 150 |
11 | 80 |
In SQL, If I do an Inner Join with On A.Key = B.Key and A.Value <> B.Value, I get
Key | Value |
---|---|
11 | 100 |
11 | 80 |
How can I achieve this in Qlikview?
Hi Koushik,
I've added two extra records to the inline tables to test. Some of the others solutions posted fail with these extra records. The third records in the inline tables should be included in the result, the fourth should not.
A:
LOAD * INLINE [
Key, Value
10, 150
11, 100
36, 79
9, 45
];
NoConcatenate
B:
LOAD * INLINE [
Key, Value
10, 150
11, 80
36, 78
9, 45
] Where Exists(Key);
Inner Join(A)
LOAD Distinct
Key Resident B;
NoConcatenate
C:
LOAD * Resident A;
LOAD * Resident B;
DROP tables A,B;
NoConcatenate
Final:
LOAD Key, Value Where ValCount = 1;
LOAD
Key , Value , Count(Value) as ValCount
Resident C Group by Key, Value;
Drop Table C;
Returns
Key | Value |
---|---|
11 | 80 |
11 | 100 |
36 | 78 |
36 | 79 |
Cheers
Andrew
Thanks loveisfail.
Thanks for taking your time to answer this question. I figured it out myself later. Forgot to close this thread.