Forum Discussion

Clay's avatar
Clay
Cloud Apps
04-29-2024
Solved

Calculate Days Until Date+3 Years

Hello,

I am trying to calculate how many days until a certain date, provided date+3 years within a formula.  All I want to do, for example, is show how many days it is until expiration, given expiration is 3 years after the provided date, but I can't quite figure out how to do this.  I know Sisense and date functions are like oil and water for some reason but this isn't that difficult of a calculation.  I should also mention, editing the underlying data source or elasticube (live model in this case) is not (nor should it have to be with a BI tool) an option.  Scripting would be a last resort but not off the table.  Any help would be greatly appreciated!

Logically it would be something like this, but of course this doesn't work (not worried about leap years so 365*3=1095 to simplify)

 

 

DDiff(NOW(),[MyDate]+1095)

 

 

 A very simple Excel formula for reference as well:

 

 

DATEDIF(TODAY(),EDATE(A2,36),"d")

 

 

 

  • Hey Clay 

    Wouldnt this work for you?

     

    max(ddiff(NOW(),[MyDate]))+1095

    When this reaches 0 the term will expire

     

    Hamza

3 Replies

  • HamzaJ's avatar
    HamzaJ
    Data Integration

    Hey Clay 

    Wouldnt this work for you?

     

    max(ddiff(NOW(),[MyDate]))+1095

    When this reaches 0 the term will expire

     

    Hamza

    • Clay's avatar
      Clay
      Cloud Apps

      Thank you HamzaJ!  This isn't exactly what I needed but it sparked an idea to make something close to this work.

  • Hello Clay,

    I wanted to follow up to see if the solution offered by HamzaJ worked for you.

    If so, please click the 'Accept as Solution' button so that other users with the same questions can find the answer faster. If not, please let us know so that we can continue to help.

    Thank you.