Skip to main content
Announcements
Accelerate Your Success: Fuel your data and AI journey with the right services, delivered by our experts. Learn More
cancel
Showing results for 
Search instead for 
Did you mean: 
Oero
Contributor III
Contributor III

months_between is not working

What's wrong am I doing here could someone please help - 

LOAD

    count(distinct rule_id) as [id counts],

    ceil(months_between(today(), reporting_date)/30.44) as MonthsBucket

RESIDENT [table_name];

it gives me error after months_between open bracket


 

 

Labels (2)
2 Replies
Gabbar
Specialist
Specialist

in the Version I am using there is no function of months_between and i do not know if it even exist as there is no information regarding this function.
Try this:
(Year(Today())-year(reporting_date))*12 + (Num(Month(Today()))-Num(Month(reporting_date))) as MonthsBucket

NadiaB
Support
Support

Hi @Oero 

It seems months_between is an Oracle function 

https://docs.oracle.com/cd/B12037_01/server.101/b10759/functions079.htm

The functions available in Qlik are listed here:

https://help.qlik.com/en-US/sense/February2023/Subsystems/Hub/Content/Sense_Hub/Scripting/DateAndTim...

There are some samples in community in how to achieve something similar:

https://community.qlik.com/t5/QlikView-App-Dev/How-Do-I-Get-the-Number-of-Months-Between-Two-Dates/t...

Hope it helps. 

Don't forget to mark as "Solution Accepted" the comment that resolves the question/issue. #ngm