Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi All,
I want to show only first record in straight table
eg: My data has multiple line numbers against multiple PO numbers. Output should show only the first line number against each PO number.
PO Line Number
16100 1
16100 2
16100 3
16200 2
16200 3
15300 4
15300 5
Output should be:
PO Line Number
16100 1
16200 2
15300 4
Please give front end solution.
Thanks.
Hi,
Should work with :
TABLE1:
LOAD *
INLINE [
PO ,Line_Number
16100 ,1
16100 ,2
16100 ,3
16200 ,2
16200 ,3
15300 , 4
15300 , 5]
;
TABLE2:
LOAD min(Line_Number),PO
resident TABLE1
GROUP BY PO;
DROP TABLE TABLE;
You must use the FirstValue function.
Try using this code.
LineNumberTable:
LOAD * INLINE [
PO , LineNumber
16100 , 1
16100 , 2
16100 , 3
16200 , 2
16200 , 3
15300 , 4
15300 , 5
];
FirstValueTable:
LOAD
PO as new_PO ,
FirstValue( LineNumber) as new_LineNumber
Resident LineNumberTable
Group By PO ;
DROP Table LineNumberTable;