Skip to Content

Dates comparison in sap analytics cloud

Friends

I am trying to compare 2 date dimensions to see the result value as "boolean" say True or False.

Context: say we have 2 date dimensions

1)Adate(MM-DD-YYYY)

2)Bdate(MM-DD-YYYY)

---------------------------------

Calculation/Comparision needed : If(Adate<=Bdate,"A" elsif Adate>Bdate then "B" else "NA")

Could you share your experiences...

Thanks-Bose

Add a comment
10|10000 characters needed characters exceeded

Related questions

2 Answers

  • Best Answer
    Posted on Oct 18, 2019 at 02:05 PM

    Hi Bose,

    You could try something like this:

    IF([Adate] <= [Bdate], 'A', IF([Adate] > [Bdate], 'B', 'NA' ) )

    SAP Analytics Cloud supports creating nested IF statements.

    In the screenshot, I have used a date field (which is actually a hierarchy) and selected day. But the logic is the same.

    Kind regards,

    Martijn van Foeken | Interdobs


    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Oct 18, 2019 at 08:29 PM

    Hi Bose,

    I created the example with the BestRun_Demo model. Can you compare the setup of the hierarchy in that model compared to your own to detect any differences?

    Kind regards,

    Martijn van Foeken | Interdobs

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.