Skip to main content
Question

How to use TODAY() function inside WORKDAYS_BETWEEN()?

  • January 9, 2026
  • 2 replies
  • 23 views

andres.naran12
Level 8
Forum|alt.badge.img+10

Hi community.

I have a question regarding WORKDAYS_BETWEEN function, currently, I’m trying to get the number of workdays between the creation date of a ticket and its current date, according to Argentine calendar. This is the PQL I have so far.

WORKDAYS_BETWEEN (

"XXXX"."fields$created",

TODAY(),

  FACTORY_CALENDAR(

            "FACTORY_CALENDAR_ARGENTINA"."START",

            "FACTORY_CALENDAR_ARGENTINA"."END"

        )

)

For some reason, the PQL doesn’t return any results for any case. I tried this calculation with other functions like DAYS_BETWEEN instead, and it works. However, I need to take into consideration only the Argentine workdays.

I’m not sure if WORKDAYS_BETWEEN supports the TODAY() functions. Has anyone faced a similar problem?

 

Best!

2 replies

abhishek.chatu14
Level 11
Forum|alt.badge.img+8

WORKDAYS_BETWEEN  supports TODAY() function , can you help us understand what are the details in your  FACTORY_CALENDAR_ARGENTINA table ?


This is how you can test if TODAY() is the actual issue

WORKDAYS_BETWEEN (

"XXXX"."fields$created",

TODAY(),

WEEKDAY_CALENDAR ( MONDAY TUESDAY WEDNESDAY THURSDAY FRIDAY ))


andres.naran12
Level 8
Forum|alt.badge.img+10

Hi Abhishek.

I did your test with your recommendation using the WEEKDAY_CALENDAR instead, and it is able to calculate the number of days between both dates. However, in this case, I need to use the FACTORY_CALENDAR since I need to take into consideration only the Argentine workdays, I mean weekends, and holidays should not be taken into consideration.

I normally use this calendar to build other KPIs with other date fields and work without any problem, but not with the TODAY() function. I have the start date and end date in this format for the FACTORY_CALENDAR:

This is a brief example.

I hope this helps to have a bigger picture.

Thanks!