cancel
Showing results for
Did you mean:

# Calculate Days Until Date+3 Years

7 - Data Storage

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")``

1 ACCEPTED SOLUTION
12 - Data Integration

Hey @Clay

Wouldnt this work for you?

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

When this reaches 0 the term will expire

Hamza

3 REPLIES 3
12 - Data Integration

Hey @Clay

Wouldnt this work for you?

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

When this reaches 0 the term will expire

Hamza

7 - Data Storage

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

Community Team Member

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.

David Raynor (DRay)
Community Toolbox

Developers Group:

Product Feedback Forum:

Submit a Support Request

The Legal Stuff

Have a question about the Sisense Community?

Email [email protected]