Skip to Content
avatar image
Former Member

HOW TO CREATE ROLLING MONTHS LOGIC IN IDT

Hi All,

I have universe created on top of multiprovider using information designer tool (IDT) with relational connection. I need to create rolling months predefined filters in the universe, Like rolling 3 months,rolling 13 months etc. can anyone suggest or guide in deriving the logic for this in IDT

Thanks

Usha

Add comment
10|10000 characters needed characters exceeded

  • Follow
  • Get RSS Feed

1 Answer

  • avatar image
    Former Member
    Nov 19, 2013 at 05:48 PM

    Two things:

    Firstly, you need to be clear what you mean by rolling three months. Is it:

    The month we are currently in plus the previous 2

    The month we are currently in plus the previous 3

    The previous 3 months before the one we are currently in.

    The second thing - what DBMS are you using as if you are doing it at database level within IDT, you will need to use the correct syntax e.g. Oracle uses sysdate, SQL Server uses getdate

    Add comment
    10|10000 characters needed characters exceeded

    • Hi...Try this.

      select

      DATE_ID as DATE_ID,

      'Last 3 month' as Periods

      from td_Date

      where

      CalendarDate between DATEADD(mm,-3,DATEADD(mm,DATEDIFF(mm,0,GETDATE()),0))

      and DATEADD(ms,-3,DATEADD(mm,0,DATEADD(mm,DATEDIFF(mm,0,GETDATE()),0)))

      union all