Is it possible to create analysis for a migrated dashboard?

I was able to migrate a Quicksight dashboard using the create template and create dashboard API calls.
But if I need the analysis of the migrated dashboard, would create analysis work?
I tried this command but am getting errors like:

An error occurred (ValidationException) when calling the CreateAnalysis operation: Invalid analysis arn given : arn:aws:quicksight:us-west-2:6********:analysis/1033bc82-daa5-4369-8aae-21565273446f

Hi @gopinathpc

You can use CreateAnalysis API to create an Analysis from the template. You can provide the template ARN in ‘SourceTemplate’.

 ],
   "SourceEntity": { 
      "SourceTemplate": { 
         "Arn": "string

", “DataSetReferences”: [ { “DataSetArn”: "

string

", “DataSetPlaceholder”: "

string

" } ] } }

Alternately, you can use ‘Save As’ option using the console to create an Analysis out of a Dashboard.

Yes, I am using the create analysis API. What do I need to provide for the analysis ID?
I am getting this error when I run the create analysis:

An error occurred (ValidationException) when calling the CreateAnalysis operation: Invalid analysis arn given : arn:aws:quicksight:us-west-2:6********:analysis/1033bc82-daa5-4369-8aae-21565273446f

Also since I migrated the dashboard from another account, I don’t see an option to “Save as” in the dashboard menu.

Hi,

Below is my json definition for an analysis i created ( create-analysis — AWS CLI 2.7.29 Command Reference ) . This creates a new analysis in my target account referencing the template from the source account .

AnalysisId and Name : The id and name that i want this analysis to be available in the target account.

{
    "AwsAccountId": "target_aws_account_id",
    "AnalysisId": "saas-bar-chart-order-test",
    "Name": "saas-bar-chart-order-test",
    "Permissions": [
        {
            "Principal": "arn:aws:quicksight:eu-central-1:target_aws_account_id:user/default/Admin/XXXXXX",
            "Actions": [
                "quicksight:RestoreAnalysis",
                "quicksight:UpdateAnalysisPermissions",
                "quicksight:DeleteAnalysis",
                "quicksight:DescribeAnalysisPermissions",
                "quicksight:QueryAnalysis",
                "quicksight:DescribeAnalysis",
                "quicksight:UpdateAnalysis"
            ]
        }
    ],
    "SourceEntity": {
        "SourceTemplate": {
            "DataSetReferences": [
                {
                    "DataSetPlaceholder": "Saas-for-bar-chart",
                    "DataSetArn": "arn:aws:quicksight:eu-central-1:target_aws_account_id:dataset/6c382dc2-68bb-4880-80c0-e4cfed51f1fb"
                }
            ],
            "Arn": "arn:aws:quicksight:eu-central-1:source_aws_account_id:template/barchart"
        }
    }
}

Regards,
Koushik

I tried the create analysis API but ran into the following issue:

aws quicksight create-analysis --cli-input-json file://create-analysis-cli-input-ANL-001.json --aws-account-id 6XXXX250484 --analysis-id a1b2c3d4ANL-001 --name ANR-001 --source-entity ANL-001

Error parsing parameter ‘–source-entity’: Expected: ‘=’, received: ‘EOF’ for input:
ANL-001
^

Hi,

You are already referencing a json file as input as part of the create-analysis command, you do not require the other parameters.

The workshop has examples which should help you : Workshop Studio

Thanks for the suggestion
I ran the command without parameters and I got errors when describing the analysis:

aws quicksight describe-analysis --aws-account-id 61XXXX250484 --analysis-id a1b2c3d4ANL-001
{
“Status”: 200,
“Analysis”: {
“AnalysisId”: “a1b2c3d4ANL-001”,
“Arn”: “arn:aws:quicksight:us-west-2:61XXXX4250484:analysis/a1b2c3d4ANL-001”,
“Name”: “ANL-00:General Report”,
“Status”: “CREATION_FAILED”,
“Errors”: [
{
“Type”: “INTERNAL_FAILURE”,
“Message”: “An error occurred while processing the request”
}
],
“DataSetArns”: [],
“CreatedTime”: “2022-09-19T07:05:48.977000-07:00”,
“LastUpdatedTime”: “2022-09-19T07:05:49.770000-07:00”,
“Sheets”: []
},
“RequestId”: “bcdfcb71-ab40-47df-af9e-1ccb39b55ae7”
}

Hi,
The analysis creation has failed, please revalidate your steps.
If facing further issues, I would suggest that you log a ticket so that team can debug the issue.

If you have access to the AWS console of the AWS account where you’re using QuickSight, please see these instructions on how to raise a support case.

If you do not have access, you’d need to ask whoever manages your AWS account for you to raise a support ticket.

Regards,
Koushik