cancel
Showing results for 
Search instead for 
Did you mean: 

DDiff from a date field to current date/now

FollowTheData
7 - Data Storage
7 - Data Storage

I used this formula to get days from creation to deactivation.

DDiff([Days in Client Last Deactivated On],[Days in Client Creation Date])

What formula can I use to obtain days from creation to current date/now?

I only have designer access to Sisense and do not have access to the data cube. 

 

 

 

 

2 REPLIES 2

HamzaJ
12 - Data Integration
12 - Data Integration

Hey @FollowTheData ,

You can use NOW() as a function in the formula. It does depend on your sisense version. Should work on Linux. I do think you will need to aggregate the formula max(ddiff())

Hamza

Jake_Raz
10 - ETL
10 - ETL

I've used a similar formula in the past. We actually used a CASE formula to alternate between two scenarios: measuring between an 'open' and 'closed' date, and then if there is no 'closed' date, then measuring between the 'open' date and the current date. It was useful enough that I "starred" it for future reference in our system 🙂

Jake_Raz_0-1737049475558.png

case 
when [# of unique Days in Dispute Closed On]=0
then min(DDIFF(Now([Days in Dispute Opened On]),[Days in Dispute Opened On]))
else min(DDIFF([Days in Dispute Closed On],[Days in Dispute Opened On]))
end

Since it's only two conditions, you could probably do the same thing with a regular IF formula instead of CASE, but the CASE lets you add more conditions in the future if need be.