Qlik Community

QlikView App Development

Discussion Board for collaboration related to QlikView App Development.

Announcements
Qlik Analytics Tour 2020 Online. Begins August 10th. Register Today
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Partner
Partner

distinct data

Hi

With the script below I have a result of 4 rows including PID '123' two times (with 'ab' and 'abcdef'). 

Now I'd like to keep only one row if it has the same PID  : in this cas I'd like to keep '123', 'abcdef' instead of '123', 'ab'

 

Table1:
LOAD * Inline [
PID , brand
123 , ab
120, ab
];

NoConcatenate
Table2:
LOAD * Inline [
PID , brand
123 , abcdef
145 , ab
];


Concatenate
Load distinct *
Resident Table1;

 

Result wanted :

120, ab

123, abcdef

145, ab

 

Thanks

Labels (2)
2 Solutions

Accepted Solutions
Highlighted
Creator II
Creator II

Re: distinct data

Try with this...

Table2:
LOAD * INLINE [
  PID, brand
  123, abcdef
  145, ab
];

Table1:
LOAD * INLINE [
  PID, brand
  123, ab
  120, ab
]
WHERE Not Exists(PID);

 

View solution in original post

Highlighted
Creator II
Creator II

Re: distinct data

 

Table1:
LOAD * INLINE [
  PID, brand
  123, ab
  120, ab
];

Table2:
NOCONCATENATE
LOAD *, PID AS tmpPID
INLINE [
  PID, brand
  123, abcdef
  145, ab
]
;
CONCATENATE(Table2)
LOAD * RESIDENT Table1
WHERE Not Exists(tmpPID, PID);

DROP TABLE Table1;
DROP FIELD tmpPID;

 

View solution in original post

3 Replies
Highlighted
Creator II
Creator II

Re: distinct data

Try with this...

Table2:
LOAD * INLINE [
  PID, brand
  123, abcdef
  145, ab
];

Table1:
LOAD * INLINE [
  PID, brand
  123, ab
  120, ab
]
WHERE Not Exists(PID);

 

View solution in original post

Highlighted
Partner
Partner

Re: distinct data

Is it possible to get the same result without changing the order of table LOADS ?
Highlighted
Creator II
Creator II

Re: distinct data

 

Table1:
LOAD * INLINE [
  PID, brand
  123, ab
  120, ab
];

Table2:
NOCONCATENATE
LOAD *, PID AS tmpPID
INLINE [
  PID, brand
  123, abcdef
  145, ab
]
;
CONCATENATE(Table2)
LOAD * RESIDENT Table1
WHERE Not Exists(tmpPID, PID);

DROP TABLE Table1;
DROP FIELD tmpPID;

 

View solution in original post