joant95
joant95

Reputation: 87

AWS Quicksight parseJson function not working with redshift

How to fix parseJson function error in AWS Quicksight?

I have a json column in AWS redshift called discount_codes of type varchar. The data looks like this:

{'code': 'blabla', 'amount': '12.00', 'type': 'percentage'}

I want to have a seperate column for 'code' in Quicksight. There is a function for this called parseJson. The formular should look like this.

parseJson({discount_codes}, "$.code")

Unfortunately it is not working and giving me the following error:

[Amazon](500310) Invalid operation: JSON parsing error Details: ----------------------------------------------- error: JSON parsing error code: 8001 context: invalid json object {'code': 'blabla', 'amount': '12.00', 'type': 'percentage'}

Any idea how to fix this?

Upvotes: 0

Views: 729

Answers (1)

joant95
joant95

Reputation: 87

I could fix it by myself. The json column had single quotation marks. I replaced them by normal ones. Now the data looks like this:

{"code": "blabla", "amount": "12.00", "type": "percentage"}

parseJson works now.

Upvotes: 1

Related Questions