Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
below formula is not working at data load editor
if((len (mi_end) <=0 ),date(Today()) - date(mi_start) ,mi_end - mi_start ) as mi_duration_new1,
Not sure what you mean by "not working". You'll have to elaborate on this one.
Len() can't be less than zero, and using len() on a date is kind of odd.
Date(mi_start) shouldn't be necessary, mi_start should be enough.
Coalesce(mi_end,Today()) - mi_start sounds like it might work here.
if((len (mi_end) <=0 ),date(Today()) - date(mi_start) ,mi_end - mi_start ) as mi_duration_new1,
actually i am trying this formula at back end , where i am trying to calculate the time duration .
if mi_end value is not present or is null in that case it should take today's date and calculate no of days .
like if submitted date is 2/2/2023 and request is still in submitted state so it should give me no of days it is in submitted state today() - 2/2/2023 , where 2/2/203 is the start end and toady is the end date .
what formula i can apply for this logic implementation?
Have you tried the one I suggested?
it did not work
That's not specific enough to work with, I'm afraid...
That formula should work if the values are either null or a valid date, and the fields are recognized as dates. I'd suggest confirming that this is the case for your data.
Just using the following should be enough:
alt(mi_end, today()) - mi_start as mi_duration_new1