Forum Discussion
Missing data when loading a view from Oracle
- 1 year ago
After some debugging, research and several trials, I managed to find the root cause of the problem.
In the view, there is a function converting dates to day of week numbers. If using to_char(sysdate, 'D'), then the output of this function can be different according to where the query is coming from, and what NLS setting is set up in that server. So a different function should be used: TRUNC(sysdate) - TRUNC(sysdate, 'IW'), then you need to add +1 (if you want to have 1 for Monday and 7 for Sunday).
See more details here: https://stackoverflow.com/questions/14517761/using-oracle-sql-how-does-one-output-day-number-of-week-and-day-of-week/71970759#71970759
smoortema If you are using Direct Query mode, try switching to Import mode to see if the issue persists. Direct Query mode can sometimes have limitations or issues that do not occur in Import mode.
Here is an example of how you might modify your M code to use Table.Buffer to disable query folding:
let
Source = Oracle.Database("dwh1_high", [HierarchicalNavigation=true]),
TEST2 = Source{[Schema="TEST2"]}[Data],
REP_COMPLAINTS_V = TEST2{[Name="REP_COMPLAINTS_V"]}[Data],
BufferedTable = Table.Buffer(REP_COMPLAINTS_V)
in
BufferedTable