Forum Discussion

acg's avatar
acg
Icon for Resolver I rankResolver I
5 years ago
Solved

Last Quarter dates (distinct) needed

For a time calender I need the comparable 9distinct) last day of the quarter of the last quarter.    I am trying this, but not sure what neeeds to e changed:   CompareDateQuarter = DATEADD( DIST...
  • VahidDM's avatar
    5 years ago

    Hi acg 

    If you want to find the last day of the last quarter based on Today Date (or any specific date), you can use the below code:

    CompareDateQuarter =
    VAR _Today =
        TODAY ()
    RETURN
        VAR _LastQuarter =
            QUARTER ( _Today ) - 1
        RETURN
            VAR _LastQMonth = _LastQuarter * 3
            RETURN
                DATE ( YEAR ( _Today ), _LastQMonth + 1, 1 ) - 1

     

    The output will be as below:

    Did I answer your question? Mark my post as a solution!

    Appreciate your Kudos  !!