Skip to main content

This content has been archived and is no longer being updated. Links may not function; however, this content may be relevant to outdated versions of the product.

Support Article

First day of week does not change to Monday

SA-46573

Summary



In report definitions, when 'previous week' is selected as a filter criteria, the week starts from Sunday.

One must change the first day of week to Monday from Sunday.

Following the PDN article in the link below, user changed the default locale to tr_TR but that does not help:

https://pdn.pega.com/community/pega-product-support/question/how-change-start-date-calendar


Error Messages



Not Applicable


Steps to Reproduce

  1. Create a report definition.
  2. Add filter condition.
  3. From select values button choose previous week.


Root Cause



The pxWeek Function alias works in this manner.

Resolution



User can customize Rule-Alias-Function pxWeek as per the requirement and use that in filters.

A sample guide for the implementation could like below :

There are few other Out-of-the-box (OOTB) functions as well that could be used in conjunction to achieve the requirement.

For example, the Day Of Week





Click the fx button to open the below window:



Here the pxDayOfWeek returns the value of the Today’s date with respect to the first day of the week.

The first day of the week can be set to 2 as Monday which becomes input parameter to this function.

Thus if Today is Wednesday the output of this function will be 2 (Wednesday – Monday).

Thus user requires the Previous Monday (of the Previous Week alias) the calculation will be like below:

Previous Monday = [(Current Day) – {pxDayofWeek(Current_TimeStamp, 2) +7}]

Thus the custom function should have a code that will take the pxDayOfWeek function as the input and add 7 to it.
Then the sum needs to be subtracted from Today’s date to arrive previous Monday.

Similarly for custom Next Week alias the output of the pxDayOfWeek function( that comes as an input parameter) should be subtracted from 7, to arrive next Monday.

Published March 22, 2018 - Updated October 8, 2020

Was this useful?

0% found this useful

Have a question? Get answers now.

Visit the Collaboration Center to ask questions, engage in discussions, share ideas, and help others.

Did you find this content helpful?

Want to help us improve this content?

We'd prefer it if you saw us at our best.

Pega Community has detected you are using a browser which may prevent you from experiencing the site as intended. To improve your experience, please update your browser.

Close Deprecation Notice
Contact us