Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi
I am using Age function to calculate employee tenures, and I'd like to get two figures below decimal points, but only integer number is generated as the calculation result. I'd like to see the months before the completion of 1 year to be also shown after joining the company. Please could you let me know how I can get below decimal points for Age() function?
Thanks a lot for your help.
As it seems Age() function is set at integer value, I decided to use a subtraction of hiring dates from Leaving date or max(DateField) to get the non-integer tenure figure. The calculation result of the expression below is generated in number of days, and I'm wondering if there is a similar function to YearFrac in excel or Power BI in Qlik Sense to convert it to fraction of years.
Thanks a lot for your help.
Hi,
If your function is returning the number days in tenure you could wrap it in a calculation like this:
num(((sum(Your calculation))/365),'#.##')
The hashes in the num( ) function will round your results to two decimal points.
I hope this helps.
Thanks
Anthony
Hello,
Thanks for your response, but I have a feeling that this formula with absolute value of 365 does not address the leap year issue which has 366 days (i.e. 29th February) every 4 years. Is there a specific Qlik Sense formula which is addressing the intricacies of leap years to calculate year fractions?
Hi,
I've been looking into the functionality of YearFrac( ) and I assume you're looking at the Basis "1" where it is calculating on Actual/Actual. I haven't been able to find any function in Qlik that calculates the same way as this.
Regards
Anthony