locked
Named calculation RRS feed

  • Question

  • Hello, in my table of fact I have 2 dates: a settlement date and an expiration date and they are of integer types. I wanted to add a Named calculation in such a way that it calculates the difference between these dates, only I have this message of erereur that I do not understand why while I previously worked with Named calculation . Please any idea how to proceed . thank's 

    Thursday, June 1, 2017 8:21 AM

Answers

  • Hi AsmaGh,

    Thanks for your question.

    In this scenario, please try below expression:

    CASE 
    WHEN [Date RegEcheant] - [Date Reglement] = 0 THEN 'Paye'
    WHEN [Date RegEcheant] - [Date Reglement] > 15 THEN '.....'
    WHEN [Date RegEcheant] - [Date Reglement] < 15 
          and [Date RegEcheant] - [Date Reglement] > 0 THEN '.....'
    END


    Best Regards
    Willson Yuan
    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com

    • Marked as answer by AsmaGh Friday, June 2, 2017 7:46 AM
    Friday, June 2, 2017 2:56 AM

All replies

  • Hello,

      What's the type of your two date that you are using?, cause somtimes for the SSAS if u put = 0 that means he waiting integer type.

    Regards,


    Reponse

    Thursday, June 1, 2017 10:30 AM
  • their type is integer 
    Thursday, June 1, 2017 10:33 AM
  • Hi AsmaGh,

    Thanks for your question.

    In this scenario, please try below expression:

    CASE 
    WHEN [Date RegEcheant] - [Date Reglement] = 0 THEN 'Paye'
    WHEN [Date RegEcheant] - [Date Reglement] > 15 THEN '.....'
    WHEN [Date RegEcheant] - [Date Reglement] < 15 
          and [Date RegEcheant] - [Date Reglement] > 0 THEN '.....'
    END


    Best Regards
    Willson Yuan
    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com

    • Marked as answer by AsmaGh Friday, June 2, 2017 7:46 AM
    Friday, June 2, 2017 2:56 AM