Skip to main content
Announcements
See why Qlik is a Leader in the 2024 Gartner® Magic Quadrant™ for Analytics & BI Platforms. Download Now
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

looking for different rows in 2 tables, maybe kind of "unkeep" load ;)

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)

1 Solution

Accepted Solutions
maxgro
MVP
MVP

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;

View solution in original post

2 Replies
maxgro
MVP
MVP

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;

Anonymous
Not applicable
Author

thank you, apparently as a novice I was thinking too complicated:)