2 Replies Latest reply on Oct 24, 2018 10:22 AM by pushyami gundala

    Custom SQL query is not pulling JSON data in the column

    pushyami gundala

      I am trying to make a Custom query to Mysql DB from tableau. I am able to connect to the DB and make Queries. The problem I am encountering is when doing a custom query like below where  I am trying to extract JSON data.

      {"week_num_start": 5, "week_num_end": 7, "grade": "all", "course_id": "123456"} (JSON string is stored as dataType: Text in the DB instead of DataType: JSON)

      SELECT json_extract(cast(extra AS json), '$.course_id') as course_id, timestamp, action FROM eventlog

       

      When i query this from the Mysql Client I see the result as I wanted but from tableau I don't the course_id being extracted only thing the query pulls is the timestamp, action column.

       

      Mysql Version: 5.7 and Tableau version:2018.2.3. Can somebody help me why tableau is not able to pull the json_extract data.? I now have to do some weird String manipulation and I see the RegExp extract function are not supported in order to extract the data I wanted.