Oracle Analytics Cloud and Server

Welcome to the Oracle Analytics Community: Please complete your User Profile and upload your Profile Picture

OBIEE Concat issue

Received Response
473
Views
8
Comments
Pahadia
Pahadia Rank 3 - Community Apprentice

Hi,

      I am trying to get 2018 Q2 from this expression

CONCAT(CAST(YEAR(CURRENT_DATE) as CHAR),' Q',CAST(QUARTER_OF_YEAR(CURRENT_DATE) AS CHAR))

However I am getting "Formula syntax is invalid." error

If I use first two or last 2 of the concat string it works but all three together not working.

Any thoughts whats wrong here.

Answers

  • Sherry George
    Sherry George Rank 7 - Analytics Coach

    Look at the syntax for OBIEE CONCAT function.

    CONCAT(CONCAT(CAST(YEAR(CURRENT_DATE) as CHAR),' Q'),CAST(QUARTER_OF_YEAR(CURRENT_DATE) AS CHAR))

  • What Sherry George said.

    You can't "invent" the number of parameters of a function yourself: CONCAT requires 2, exactly 2 parameters. You try to use 3, can't work, so embed and extra CONCAT to first concatenate 2 pieces and then concatenate again 2 pieces and done.

    PS: OBIEE isn't Excel accepting as many parameters you want

  • [Deleted User]
    [Deleted User] Rank 2 - Community Beginner
    Gianni Ceresa wrote:You can't "invent" the number of parameters of a function yourself...OBIEE isn't Excel accepting as many parameters you want 

    Amen and halleluja

  • Chris Arnold
    Chris Arnold Rank 5 - Community Champion

    Have you tried just using the pipes to concat? Something like this:

    CAST(YEAR(CURRENT_DATE) as CHAR)||' Q'||CAST(QUARTER_OF_YEAR(CURRENT_DATE) AS CHAR)

  • Adam Wickes
    Adam Wickes Rank 6 - Analytics Lead

    Is it a regular occurrence for people to receive their answer and then take off like they were never here. A simple thank you wouldn't go astray surely?

  • [Deleted User]
    [Deleted User] Rank 2 - Community Beginner

    Say "thanks"?! Are you mental?

  • Pahadia
    Pahadia Rank 3 - Community Apprentice

    Thanks a lot for solution. It perfectly worked.

  • Pahadia
    Pahadia Rank 3 - Community Apprentice

    My apologies all. I could not get chance earlier to come on board & say "Thanks you"

    This board has been so helpful & you guys are very generous with your time & efforts to reply & provide guidance.

    Thanks a million again !!!!