If you’re new to Qlik Sense, start with this Discussion Board and get up-to-speed quickly.
I have two columns of dates in my data
DateOfHire - each row has a date populated
DateOfTermination - some rows have dates, others do not
I am trying to make a calculated field that shows the number of days between 1) Hire and Termination, or if they are still employed, 2) Hire and Today's Date
My formula is setup as this:
If(DateofTermination = '', today() - DateofHire, DateofTermination - DateofHire)
It returns the number of days DateOfTermination - DateOfHire, but not when there is a null value in DateOfTermination and I try to use today's date instead.
Can someone help me understand what I'm missing to make this formula calculate properly? Thank you!
Hi, you can try with:
If(Len(Trim(DateofTermination))=0, today() - DateofHire, DateofTermination - DateofHire)