Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
maestro444
Contributor II
Contributor II

Next table value if null

TIME                              FILENAME          VALUE1               VALUE2

2012.11.26 00:01:17AAEU.csv01.29662
2012.11.26 00:01:17INEU.csv1.29670
2012.11.26 00:01:18AAEU.csv01.29666
2012.11.26 00:01:19AAEU.csv01.29669
2012.11.26 00:01:20AAEU.csv01.29669
2012.11.26 00:01:49AAEU.csv01.29669
2012.11.26 00:02:02AAEU.csv01.29671
2012.11.26 00:02:02INEU.csv1.296710
2012.11.26 00:02:07AAEU.csv01.296855
2012.11.26 00:02:08AAEU.csv01.29681

Hello, is there any function that can help solving following issue?

I have a range of values which i want to compare by time,

I need the following logic: If row value equals to zero, then take previous value which is not equal to zero.

I've tried previous function, but I made mistake in the formula, as I am not familiar with creating counters. And looks like some kind of counters should be created there to pick the right value avove.

=IF(VALUE1=0,previous(VALUE1),VALUE1 as VALUE1_COUNTED,

Would be very thankful for any hints.

1 Solution

Accepted Solutions
Gysbert_Wassenaar

It's not clear to me what you want. Try this and see if it does what you need:

LOAD Time,

     filename,

     if(rowno()=1 or INEU<>0,INEU,peek('NewINEU')) as NewINEU,

     AAEU

FROM Data.skv

(txt, codepage is 1252, embedded labels, delimiter is ';', msq);


talk is cheap, supply exceeds demand

View solution in original post

2 Replies
Gysbert_Wassenaar

It's not clear to me what you want. Try this and see if it does what you need:

LOAD Time,

     filename,

     if(rowno()=1 or INEU<>0,INEU,peek('NewINEU')) as NewINEU,

     AAEU

FROM Data.skv

(txt, codepage is 1252, embedded labels, delimiter is ';', msq);


talk is cheap, supply exceeds demand
maestro444
Contributor II
Contributor II
Author

Thanks! That's exactly what I wanted.