Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
hello,
as a few days young qlikviewer I´ve just got stuck how to find/display rows with different values in two tables.
"keep" I have found, this is rather lovely function but delivering exactly the opposite result from waht I am looking for.
Example:
baseTable:
load * INLINE [
F1, F2
01, equalValues
02, B
];
result:
inner keep
LOAD * INLINE [
F1, F2,
01, equalValues
02, notB
03, anExtraRow
];
The "keep" creates nicely table with single row only (01, equalValues).
Nifty!
But I need find out 2 rows:
row1: (02, B) because "B" differs from "notB") and
row2: (03, anExtraRow) , because, well this row differs from all raws in the baseTable, it is extra.
Can someone give me a hint or even a code example, please?
Note: this is a simplified example, the real tables contain about 10 rows which all must equal in order to exclude this raws from the resulting table. Table lengths are about 10.000.
Totaly different solutions are welcome as well, as long as I will find out which rows differ in particular values or miss or are extra in one table. Maybe a join adding a column with values ("equal"/"some values different"/"extra row in table one")... okay okay, I stop dreaming now.
greetings from -at the very moment - rainy austria
juraj (george)
I think you can join the table by key (F1) and then check the values in F2
// load the first table
//
baseTable:
load F1, F2 as F2_Table1 INLINE [
F1, F2
01, equalValues
02, B
];
// load and join the second table
//
join (baseTable)
LOAD F1, F2 as F2_Table2 INLINE [
F1, F2,
01, equalValues
02, notB
03, anExtraRow
];
// check for equal values
Result:
NoConcatenate LOAD
*,
F2_Table1 = F2_Table2
Resident baseTable;
DROP Table baseTable;
I think you can join the table by key (F1) and then check the values in F2
// load the first table
//
baseTable:
load F1, F2 as F2_Table1 INLINE [
F1, F2
01, equalValues
02, B
];
// load and join the second table
//
join (baseTable)
LOAD F1, F2 as F2_Table2 INLINE [
F1, F2,
01, equalValues
02, notB
03, anExtraRow
];
// check for equal values
Result:
NoConcatenate LOAD
*,
F2_Table1 = F2_Table2
Resident baseTable;
DROP Table baseTable;
thank you, apparently as a novice I was thinking too complicated:)