Clarity

  • 1.  Need auery to get the list of holidays from the Calender

    Posted May 26, 2017 02:17 AM

    Hi Everyone,

     

    Help me with a query to get the list of the Holidays from the calendar.

     

    Thanks,

    Santosh.



  • 2.  Re: Need auery to get the list of holidays from the Calender

    Posted May 26, 2017 04:41 AM

    There are plenty of threads on that

    https://communities.ca.com/message/2292740?commentID=2292740#comment-2292740 

    Is there a way to read a specific Resource's Calendar data through a DB query? 

    https://communities.ca.com/message/99253912?commentID=99253912#comment-99253912 

    https://communities.ca.com/message/241861456?commentID=241861456#comment-241861456 

    https://communities.ca.com/message/241861456?commentID=241861456#comment-241861456 

    They are stored in the db in the availability blobs with zero availability and in that they do not differ from weeks. You would have to sort that out from the query results with db or other tools

     

    You would have to look at the daily availability slices in prj_blb_slices for a resource which is attached to that calender without any personal additions.



  • 3.  Re: Need auery to get the list of holidays from the Calender

    Posted May 26, 2017 06:55 AM

    I have tried writing the query.

     

    Suppose if Jan 1st is a Holiday(Non-Working Day) , will there be an option to set a name like "New Year" in Application, If yes where do I need to fetch that.

     

    Now I'm able to print "Calendar Name"  "Date"  "Holiday Yes/No" . I want to show the Holiday Name (like New Year) as explained above, different countries will have their own List of holidays , so how to get the name of the holiday?

     

    Thanks,

    Santosh.



  • 4.  Re: Need auery to get the list of holidays from the Calender

    Posted May 26, 2017 07:04 AM

    That is not in the system. I do not think that is in the db either.

    One option is to use a comment field/column with a fancy CASE statement.

    Another option is to use an auxiliary table or temporary table created with the SQL where you manually store the dates for which you have names and then left join to pull the names to the columns.

    Developers may have other options.



  • 5.  Re: Need auery to get the list of holidays from the Calender

    Posted May 29, 2017 06:24 AM

    In our Environment there are 11 Base calendars.

    To get the Holidays list I'm hard coding with Admin user ID to get the list of holidays, as he is associated with Standard calendar Query returns me the Holidays under the Standard Calendar.
    So what should be done for the rest of the Calendar holidays, Do we need to associated Admin to all other calendars and need to run the any Job and Query at last?

     

    Thanks.



  • 6.  Re: Need auery to get the list of holidays from the Calender

    Posted May 29, 2017 06:33 AM

    You get the holidays from a calendar with a user who has not personal exceptions.

    It does not matter if it is admin or a dummy or a real user as long as you can rely that there are no personal exceptions.

    Yes you need a user for each calendar and you can use the same or admin if you associate it with each calendar in turn before running the query.



  • 7.  Re: Need auery to get the list of holidays from the Calender

    Posted May 30, 2017 03:04 AM

    Which XML should be referred to XOG out the calendar. Please provide the XML if someone has. 



  • 8.  Re: Need auery to get the list of holidays from the Calender

    Posted May 30, 2017 03:18 AM

    I don't think that is possible.

    The workdays, nonworkdays and shifts are stored in a a blob so you cannot query the directly either.

    You would have to query the daily availability slices.

    There is no way to write that with XOG either.