- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
LAG function
Hi All,
I'm hoping this is an easy line of code someone can help me with.
I have a LAG function script written, but it's not letting me grab the first Run.
How can I get it to see that there's a Run 1, and not just skip it?
Attached is the data.
Thanks!
Here's my script:
Names Default To Here( 1 );
dt = Current Data Table();
dt << select where( :name( "Run" )[Row()] != Lag( :name( "Run" )[Row()] ) );
dtNew = dt << subset( selected columns( 0 ), selected rows( 1 ) );
1 ACCEPTED SOLUTION
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Re: LAG function
Created:
Jan 8, 2019 03:47 PM
| Last Modified: Jan 8, 2019 12:48 PM
(5381 views)
| Posted in reply to message from kwmcm 01-08-2019
add | row() == 1
dt << select where( :name( "Run" )[Row()] != Lag( :name( "Run" )[Row()] ) | Row() == 1 );
Vince Faller - Predictum
2 REPLIES 2
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Re: LAG function
Created:
Jan 8, 2019 03:47 PM
| Last Modified: Jan 8, 2019 12:48 PM
(5382 views)
| Posted in reply to message from kwmcm 01-08-2019
add | row() == 1
dt << select where( :name( "Run" )[Row()] != Lag( :name( "Run" )[Row()] ) | Row() == 1 );
Vince Faller - Predictum
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Re: LAG function
THANK YOU!