Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Count OrderId during Load

Hi all

I would like during the scrip-load know if the OrderId change. (comparing the previsus record value "OrderId" )

I Know that my script is wrong, but i would like obtain something similar:

Let vOrder='XXXXX';

LOAD *;

let vOrder = OrderId;

LOAD *,

if($(vOrder)<>OrderId, 1 ,0 ) as CountOrder;

SQL SELECT *

FROM LIBRARY.ORDERLINE;

Thank you for your attention

Regards

Claudio

1 Solution

Accepted Solutions
sparur
Specialist II
Specialist II

I don't use a GROUP BY statement. I use ORDER BY

View solution in original post

4 Replies
sparur
Specialist II
Specialist II

Hello, Claudio.

try something like this:

LOAD *,

IF (peek(OrderId) <> OrderId, 1, 0) as CountOrder

;

SQL SELECT *

FROM LIBRARY.ORDERLINE

ORDER BY OrderId;

Not applicable
Author

Hi

Many Thanks for your reply:

is there another solution without use group by, I have 100 million records and group by is too slow ?

sparur
Specialist II
Specialist II

I don't use a GROUP BY statement. I use ORDER BY

Not applicable
Author

Sorry work perfectly

Many Many Thanks