Forum Discussion

0918's avatar
0918
New Contributor II
6 days ago

Time - Prior11 -- newest to oldest

Is there a way to pull time in newest to oldest?

T#|CVTime|.Prior11 ---- Pulling M4 on an Oct - Sep 2025 calendar.

This will pull Feb 24, Mar 24, Apr 24, May 24, Jun 24, Jul 24, Aug 24, Sep24, Oct 25, Nov 25, Dec 25.

How do I pull the opposite - Dec 25, Nov 25, Oct 25, Sep 24, Aug 24, Jul 24, Jun 24, May 24, Apr 24, Mar 24, Feb 24?

1 Reply

  • RobbSalzmann's avatar
    RobbSalzmann
    Valued Contributor II

    I would use an XFBR that reverses the order.  

    Something like 
    Given that input is  "Feb 24, Mar 24, Apr 24, May 24, Jun 24, Jul 24, Aug 24, Sep24, Oct 25, Nov 25, Dec 25"

    code the reverse as:
    Dim reversed As String = String.Join(", ", input.Split(","c).Select(Function(s) s.Trim()).Reverse())
    Return reversed

    Edit: I just realized this is an ideastream.  oh well, there's a suggestion.