Loading

Inconsistent Weekday Values Returned from Oracle Custom SQL in Tableau

Publiceringsdatum: Jul 21, 2026
Beskrivning

Steps to Reproduce

1. Create an Oracle table with a DATE column.

2. Insert sample dates (for example, from 19-Nov-2025 to 28-Nov-2025) and commit the data.

3. Run a Custom SQL query using:

SELECT
  date_column,
  TO_CHAR(date_column, 'D') AS weekday_num
FROM table_name;

4. With NLS_TERRITORY = 'AMERICA', observe weekday values such as:

Sunday = 7

Monday = 1

Tuesday = 2

5. Change the Oracle session setting:

ALTER SESSION SET NLS_TERRITORY = 'SWITZERLAND';

6. Re-run the same query and observe different weekday values for the same dates (for example, Sunday = 6, Monday = 7, Tuesday = 1).

7. Create a Tableau workbook using this Custom SQL and verify that weekday-based logic reflects these differences.

Lösning

Set the territory via Initial SQL to ensure the correct value is retrieved or use Custom SQL to ensure the correct value is retrieved or adjust the values via calculated fields if using Date Functions.

Knowledge-artikelnummer

005389419

 
Laddar
Salesforce Help | Article