3

Hoping for some help with an issue in Google Data Studio.

I'm trying to create a time graph that contains cumulative and monthly account creations using data from my Postgres database.

I am connecting to a data source that uses custom SQL to pull from the Postgres database. When I run the query in data studio, it pulls in the columns without issue:

Index | Field     | Type           | Aggregation | Description
1     | createdAt | Date (YYYYMMDD)| None        | 
2     | count     | Number         | Sum
3     | cumulative| Number         | Sum

However, when I try to create a chart using Dimension "createdAt" and Metric "count", I get the following error:

"The query returned an error.

Error with SQL statement: ERROR: column "createdat" does not exist
  Hint: Perhaps you meant to reference the column "t0.createdAt".
  Position: 8
Error ID: bbd9f163"

I've tried using TODATE to change the format of the "createdAt" column, but I get an "Invalid Formula" error when I use a formula like: "TODATE(createdAt, 'DEFAULT_DECIMAL','%Y%m%d')"

Any suggestions as to the root cause of the error and how I might resolve it to create the desired chart?

Thanks!

DTuffy
  • 71
  • 2
  • 4
  • 1
    thanks @a_horse_with_no_name. I had thought that by encasing the column name in double quotes in my SQL query that I was okay, but I aliased the new column name to also have mixed case, and Google Data Studio wasn't able to read that data. I re-aliased to a lower case column name and it worked! – DTuffy Mar 29 '18 at 20:40
  • 1
    DTuffy - I'm running into this same issue in Studio. How did you re-alias your column names? – DonnRK Oct 07 '18 at 02:34
  • 1
    Hey @DonnRK Unfortunately, while I was able to get past the error, I was not able to get usable date format fields into data studio from Postgres. – DTuffy Oct 08 '18 at 22:37
  • I was able to resolve the issue I was having. I had to re-alias the field names into lowercase names in order for DS to properly read them (instead, I permanently renamed the fields to avoid constantly re-aliasing them). – DonnRK Oct 09 '18 at 13:21
  • Strange this is not duplicate @a_horse_with_no_name – Muhammad Sep 22 '19 at 14:02
  • @Muhammad it **is** a duplicate because the column needs to be accessed as `"createdAt"`, not as `"createdat"` –  Sep 22 '19 at 15:02
  • @a_horse_with_no_name the user is asking about something different, I read the other answers but they are not relevant. Google Studio doesn't support camel case and that's why user is getting this issue – Muhammad Sep 22 '19 at 19:17
  • @Muhammad: I don't see how the tool is relevant - just quote the table names when entering the SQL statement –  Sep 22 '19 at 20:33
  • @a_horse_with_no_name actually what this question entails is that whatever you do Google Studio doesn't accept any camel case named column, either you put double quotes or don't put anything, when Google Studio run the same query you wrote with double quotes it removes the double quotes. Thus the solution you are saying doesn't apply and this question has not answered before (at least not in the questions you mentioned it to be duplicate of) – Muhammad Sep 25 '19 at 07:17

0 Answers0