0

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?

0

1 Answer 1

1

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.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.