Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hey guys, I have a simple question:
Sequence | Status | Name |
---|---|---|
1 | Started | A |
2 | Started | B |
3 | Not Started | C |
4 | Not Started | D |
I want to create a field that says that the current position is "2" (last one started). I tried to use this:
IF(Status=PREVIOUS(Status),'',Sequence) as Current_Position.
The problem with that, is that also counts the headers, so, number "1" always come in this field, and I don't want that, i want simply to show "number 2".
How can I do that?
Thanks
Hi
You could so this after loading the data in your post:
MaxValues:
LOAD Max(Sequence) As LastStart
'Started' As Status
RESIDENT Data WHERE Status = 'Started';
To get that into a variable, use Peek()
HTH
Jonathan
Hi
You could so this after loading the data in your post:
MaxValues:
LOAD Max(Sequence) As LastStart
'Started' As Status
RESIDENT Data WHERE Status = 'Started';
To get that into a variable, use Peek()
HTH
Jonathan
Thanks it did work well! I would like to get also the number of the last item in the table. how do I do that?
Something like this should do the trick:
LET vLastItem = PEEK('FieldName', NoOfRows('TableName')-1, 'TableName');