Potential Bug when Recreating Analysis Definition

Hi all,

So when I include a percentOfTotal table calculation in a quicksight analysis (which works), and I pull the analysis definition and then recreate it, I’m greeted with the following error:

{
    "Status": 200,
    "Analysis": {
        "AnalysisId": "AgentDistribution",
        "Arn": "<arn>",
        "Name": "AgentDistribution",
        "Status": "CREATION_FAILED",
        "Errors": [
            {
                "Type": "INVALID_TABLE_CALCULATION",
                "Message": "Unsupported table calculation strategy",
                "ViolatedEntities": [
                    {
                        "Path": "sheet/aecd088c-eb06-49f1-b936-73cd9329bad3/visual/1e69ab7b-a0a3-45d0-aa22-eef260c1c908/field/02126984-fff4-4f78-9c1d-937d3ccbc882.4.1701341193636"
                    }
                ]
            }
        ],
        "DataSetArns": [
            "<arn>"
        ],
        "CreatedTime": "2023-11-30T10:59:56.658000+00:00",
        "LastUpdatedTime": "2023-11-30T10:59:57.232000+00:00",
        "Sheets": []
    },
    "RequestId": "5ae9a94b-ee4d-4163-8803-374973725ef4"
}

So it seems that either Quicksight is writing the analysis definition incorrectly, or is reading it incorrectly when recreating.

The percentOfTotal calculation itself looks like this in the definition:

         "Values": [
                      {
                        "CalculatedMeasureField": {
                          "FieldId": "02126984-fff4-4f78-9c1d-937d3ccbc882.4.1701341193636",
                          "Expression": "percentOfTotal(SUM({TimeInContactStateRaw}), [truncDate(\"MI\", {Date}),{ConnectUrl},{agentName}])"
                        }
                      }
                    ]

Any help would be greatly apppreciated.

UPDATE: If I manually add a calculated field with the same expression (replacing the expanded calcultions with the field names) then it works, so seems like a bug with the table calculation functionality

Hi @Cian_Mc_Sweeney

Can you try running CreateAnalysis API/CLI call witht he following parameter added and check if the error persists?

“ValidationStrategy”: {
“Mode”: “LENIENT”
}

This parameter determines the mode of validation for the asset to be created or updated. Validation is skipped for specific UI errors when its set to LENIENT.

Hi @Cian_Mc_Sweeney Checking in. We have not heard back from you regarding your question. We’d still like to help. If we do not hear back in the next 3 days, we will archive the question