Client Lifespan Custom Calculation

Hello!

I am attempting to build a look showing average client lifespan.

The applicable dimensions are 

client_tier_5.admission_date_date

and

client_tier_5.discharge_date_date

It’s been fairly straightforward to create a calculation to count diff_days between either the admission date and now() or admission date and discharge date, but I’m struggling to bridge the gap and create one calculation that can count diff_days between admission date and now (if discharge date is null) AND admission date and discharge date (if discharge date is not null).

What is the best approach to accomplish this? I’m still learning SQL, so any help would be appreciated. Thanks!!

0 0 50
0 REPLIES 0
Top Labels in this Space
Top Solution Authors