INVALID_CALCULATED_COLUMN_EXPRESSION errors while creating analysis via quicksight api using cli-input-json

Hi Team,

I am trying to create a quicksight analysis using aws cli with below command -
aws quicksight create-analysis --cli-input-json “file://$DefinitionPath” --tags ($TagsString -split ‘$$’) –debug

There are certain errors while creating the analysis using json input at the calculated fields level. have tried so many ways to fix but none seems to be working from last more than a day. below are the sample errors and code_snippets, please suggest

│ “Status”: “CREATION_FAILED”,
│ “Errors”: [
│ {
│ “Type”: “INVALID_CALCULATED_COLUMN_EXPRESSION”,
│ “Message”: “Calculated field Events_EventsDisplayParameter failed with error code SYNTAX_ERROR during translation”,
│ “ViolatedEntities”: “”
│ },
{
│ “Type”: “INVALID_CALCULATED_COLUMN_EXPRESSION”,
│ “Message”: “Calculated field SectorNewParameter failed with error code CONTEXTUAL_UNKNOWN_SYMBOL during validation”,
│ “ViolatedEntities”: “”
│ }

calculated fields -
{
“DataSetIdentifier”: “identifier_A”,
“Name”: “Events_EventsDisplayParameter”,
“Expression”: “ifelse(${EventsDisplayParameter}="Team Name", {team_nm}, "NA")”
},

{
“DataSetIdentifier”: “identifier_B”,
“Name”: “SectorNewParameter”,
“Expression”: “ifelse(${SectorNew}="Sector", {Industry Sector}, "NA")”
},
could somebody please help with this?

Hello @sandeepagrawal921

The calculations look fine in the code. Is it possible that the dataset you are using in your JSON file is missing some of the parameters or fields?

Could you share a snippet from your JSON file with those calculations as well?

If you could share your analysis JSON code, we might be able to help

Hey @sandeepagrawal921

Are you able to share a snippet of your JSON or were you able to solve this?

Hello @sandeepagrawal921

Since we have not heard from you in awhile this topic will be archived. If you still need help please feel free to post a new question at the top of the community.