LAE

Welcome to the LAE community!  Please feel free to start a discussion in the discussion tab or join in a conversation.

Discussions

Members

Resources

Events

 View Only
  • 1.  Convert string to date -> 2011Q1

    Employee
    Posted 11-24-2015 02:43

    Note: This was originally posted by an inactive account. Content was preserved by moving under an admin account.

    Originally posted by: andreeroos

    Hi.

    I've tried to convert this string into a date ("2011Q1") but haven't succeeded yet. Does anyone know how to accomplish this?
    I am thankful for any suggestions.

    Cheers!


  • 2.  RE: Convert string to date -> 2011Q1

    Employee
    Posted 11-24-2015 08:57

    Note: This was originally posted by an inactive account. Content was preserved by moving under an admin account.

    Originally posted by: ryeh

    Try the attached. I'm splitting the string with the letter 'Q' and then using that to generate the year and month.

    Also, the following may also be useful if going the other direction - date to quarter:
    https://infogix.zendesk.com/hc/en-us/community/posts/360050684994
    Attachments:
    quarter2date.brg


  • 3.  RE: Convert string to date -> 2011Q1

    Employee
    Posted 11-25-2015 02:55

    Note: This was originally posted by an inactive account. Content was preserved by moving under an admin account.

    Originally posted by: andreeroos

    Thanks.
    This works beautifully.

    I, however, have a question regarding this solution. How come it is not possible to extract this information via a format? Like "CCYY*Q".
    Is it because quarters are not implemented in date formats or that you can't use wildcards?


  • 4.  RE: Convert string to date -> 2011Q1

    Employee
    Posted 11-25-2015 06:48

    Note: This was originally posted by an inactive account. Content was preserved by moving under an admin account.

    Originally posted by: ryeh

    In the help documentation for the 'date' function, you can see which formats are supported - CCYY, MM, DD, etc. Quarter number is not supported. You could have extracted just the year with:
    date(DateField,"CCYY")