3

I've created a Tableau workbook that is based off of a SQL query connecting to an Oracle Database. Let's pretend that the query has 2 fields, ID and Stock number. On the Data Source tab one row shows ID = 2040 and the Stock number = 47 but on Sheet 1, ID = 2040 shows a Stock number = 2040. The remote type of the Stock number field on the Data Source tab is "Fixed precision number" and on Sheet 1 it is "Double-precision floating-point number."

For a reason I do not understand the Stock number is equal to the ID for all rows of the data when looking at the data on Sheet 1 (or any other Sheet for that matter). This is incorrect when I look at the Data Source tab or if I use Oracle SQL Developer to run the query. Why and how is this happening in Tableau?

What I've already tried

  • Using the Stock number field as a Dimension and a Measure
  • Using "View Data" on Sheet 1 - It shows that the row where ID = 2040 also has a Stock number = 2040 instead of the correct value of 47
2602
  • 332
  • 3
  • 18
  • In the data source tab you must be looking at sample data of 100 rows. Try bringing the data source as is in the sheet one by pulling dimensions and measures into rows shelf and then sort them according to id and see if 2020 id appears only once. – Abhishek Boorugu Jan 07 '20 at 17:35
  • Hi @AbhishekBoorugu, ID = 2040 only appears once. The data being shown in the Data Source tab is correct but when I go to Sheet 1 the data being shown is incorrect. – 2602 Jan 08 '20 at 10:28
  • Are you using more than 1 datasource on the sheet? – Armin Jan 09 '20 at 17:05
  • A lot of things causing this could most likely require a look at the workbook to solve. Is that an option? – vizyourdata Jan 09 '20 at 19:24
  • Hi @Armin, no it's just 1 data source. – 2602 Jan 10 '20 at 08:06
  • Hi @vizyourdata, unfortunately no. – 2602 Jan 10 '20 at 08:07
  • From your description, it sounds like you are using custom SQL in your data source. Why? That’s seldom necessary. I’d simplify as much as possible. Make a test data source without custom SQL, just drag in the tables you need and specify your joins. Let Tableau generate the SQL. Do you see different behavior? – Alex Blakemore Jan 14 '20 at 04:24
  • Did you solve this problem? I'd try recreating the data source in a new workbook. Also, can you post the SQL you'r using? Maybev we can spot the problem. – Jim Jimson Jan 15 '20 at 06:34
  • Hi @AlexBlakemore, I am indeed using custom SQL. This is because the query was already defined. I will try out your suggestion. – 2602 Jan 15 '20 at 12:20
  • Hi @JimJimson, No, I haven't solved the problem yet. Unfortunately I can't post the SQL because it contains confidential info. – 2602 Jan 15 '20 at 12:21

1 Answers1

0

My advice is to start a new workbook and take your query right back to basics. Only have a simple select statement and return a few rows.

Then build up from there. You want to get as simple as you can, with no column aliases if you can avoid it.

From there add more complexity to your query, one step at a time so you can pinpoint the exact moment when your query stops working.

I have seen Tableau get confused by data types before, so make sure you check all of the data types that Tableau suggests when you first build your data source. And update them as necessary.

If you can remove or even blur out any sensitive content and show us a picture that would help immenesly. Obviously a picture tells a thousand words.

Jim Jimson
  • 2,368
  • 3
  • 17
  • 40
  • 1
    I’d follow Jim’s advice, except don’t even use a select statement literally. Just drag a table into the data source, test, join another table, test, repeat – Alex Blakemore Jan 16 '20 at 06:32