Articles in this section
Category / Section

How to Exclude Specific Week Days from Dashboard Created with PostgreSQL Data Source

Published:

When working with date fields in expressions, you may need to exclude specific days of the week (For example, Thursdays and Fridays). This article will guide you on how to exclude specific days from the date field using an expression.

Excluding weekdays from the date field

To exclude Thursdays and Fridays from the date field, you need to convert the date to a character format. Use the following expression to achieve this:

IF(To_Char([DateField], 'Day')!~'(Friday|Thursday)',[DateField],null)

Explanation: The To_Char function is used to convert the date to a character format, and the IF function checks if the day is not Thursday or Friday. If the day is not Thursday or Friday, the date is used in the calculation. If the day is Thursday or Friday, the date is replaced with null.

Example
We have created an expression like below. Except for Thursday and Friday, it calculates the value_count.

image.png

Refer to the following image:
image.png

Was this article useful?
Like
Dislike
Help us improve this page
Please provide feedback or comments
IJ
Written by Israel Jebaraj Chandirakumar
Updated:
Comments (0)
Please  to leave a comment
Access denied
Access denied