Skip to main content
Announcements
See what Drew Clarke has to say about the Qlik Talend Cloud launch! READ THE BLOG
cancel
Showing results for 
Search instead for 
Did you mean: 
sags
Contributor
Contributor

YearFraction in Qlik

Hello,

I am new to qlik and am trying to achieve the below excel formula in qlik. kindly help me with the Qlik equivalent expression for YEARFRAC and EOMONTH as in the excel formula below.

 

=YEARFRAC([@[min(UsageStartDate)]],[@[max(UsageEndDate)]],2)*12
+((HOUR([@[max(UsageEndDate)]])-HOUR([@[min(UsageStartDate)]]))
/(24*DAY(EOMONTH([@[max(UsageEndDate)]],0)))) 

 [@[min(UsageStartDate)]] and [@[max(UsageEndDate)]] are calculated expressions 

1 Reply
vinieme12
Champion III
Champion III

Unfortunately there is no Yearfrac in Qlik,  alternatively you can divide the (Difference in Days) / 365.24 for which results are close enough

for EOMONTH use the MonthEnd() function

https://help.qlik.com/en-US/qlikview/May2021/Subsystems/Client/Content/QV_QlikView/Scripting/DateAnd...

 

Vineeth Pujari
If a post helps to resolve your issue, please accept it as a Solution.