Qlik Community

New to QlikView

Discussion board where members can get started with QlikView.

Announcements
Read about Qlik’s Response to COVID-19 Read the Letter, Join the Group.
New Contributor III

Load distinct according to two values

Hi,

this might not be too difficult but I cannot find out how to do this.

In a load-statement I want to just load the first record where the values "OrderNo" AND "Pos" are distinct.

Example:

OrderNo, Pos, pc, val
123,3,5,10
123,3,6,15

should only load the first record.

Thank you in advace for any hint.

Tags (1)
Labels (1)
1 Solution

Accepted Solutions
Highlighted
Honored Contributor II

Re: Load distinct according to two values

try like this:

Temp:
Load * Inline [
OrderNo, Pos, pc, val
123,3,5,10
123,3,6,15
234,4,5,20
234,6,4,23
345,2,3,44
];

NoConcatenate

table1:
LOAD * Resident Temp
Where OrderNo<>Previous(OrderNo) and Pos<>Previous(Pos)
Order By OrderNo, Pos, pc, val;
DROP Table Temp;

View solution in original post

1 Reply
Highlighted
Honored Contributor II

Re: Load distinct according to two values

try like this:

Temp:
Load * Inline [
OrderNo, Pos, pc, val
123,3,5,10
123,3,6,15
234,4,5,20
234,6,4,23
345,2,3,44
];

NoConcatenate

table1:
LOAD * Resident Temp
Where OrderNo<>Previous(OrderNo) and Pos<>Previous(Pos)
Order By OrderNo, Pos, pc, val;
DROP Table Temp;

View solution in original post