Skip to Content

Hot calculate YTD, Current Month, Previous YTD in IDT?

Hello Experts,

I am looking for following formulas in IDT and I have a field YYYYMM in mydata model.

YTD-

Previous Year YTD-

Current Month-

Previous Current Month-

Complete year- for example Jan 2018 to Dec 2018

Q1, Q2, Q3, Q4 -

QTD -Quarter to date for example 201904 to 201904

Previous 3 years- 2016, 2017, 2018

Thanks in Advance!

Add comment
10|10000 characters needed characters exceeded

  • Follow
  • Get RSS Feed

1 Answer

  • May 16 at 07:07 PM

    Hi Sam,

    I'm not sure I've understood what you mean, but I guess you can easily calculate the values required considering the functions of the underlying DB.

    For example, to get the PREVIOUS YTD in SQL Server, the function in IDT could be:

    (CAST(CAST(LEFT([YOUR_DATA],4) AS INT) -1 ) AS VARCHAR(4)) + RIGHT([YOUR_DATA],2)
    Add comment
    10|10000 characters needed characters exceeded