Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
3 years ago
Solved

Second Last Value threw columns

Hello, I have a list from which I need to return the last value of a column.
This works with the following formula.

List.Last(List.RemoveItems(Record.ToList(_),{""}))

Now I wonder if it is also possible to return the second to last value in this way?

Can someone help?

  • Hi Anonymous,

     

    Yes, you can. But in a slightly differnt fashion, e.g. :

    let
        Source = {1..9},
        OneBeforeLast = Source{List.Count(Source)-2}
    in
        OneBeforeLast

    Cheers,

    John

1 Reply

  • jbwtp's avatar
    jbwtp
    Memorable Member

    Hi Anonymous,

     

    Yes, you can. But in a slightly differnt fashion, e.g. :

    let
        Source = {1..9},
        OneBeforeLast = Source{List.Count(Source)-2}
    in
        OneBeforeLast

    Cheers,

    John