Export Dashboard For Different Variable Values

Doga
Doga Registered Posts: 20 ✭✭✭

Hi - Please see below my goal, methodology, and the challenge I am facing. Thanks in advance for your help.

GOAL: I have a flow that takes a project variable while running. The output is then visualized on the dashboard. I would like to try different variable values and export the resulting dashboards. I have 10 different values I would like to try.

METHODOLOGY: I set up a scenario where I define the variable, run the flow, and export the dashboard. I have these steps replicated for all variable values.

CHALLENGE: The dashboard exports have the same name so it gets overwritten every time I get the export. Ultimately after everything runs, I only have a single file that has the output from the last variable value I used.

Answers

  • Turribeach
    Turribeach Dataiku DSS Core Designer, Neuron, Dataiku DSS Adv Designer, Registered, Neuron 2023 Posts: 2,024 Neuron

    can you please post your code in code block? (The <\> icon in the toolbar).

  • Doga
    Doga Registered Posts: 20 ✭✭✭

    I am not sure what you refer to as my code as I haven't written an actual piece of code. Please see below the screenshots of the Steps in the Scenario if that helps. I included the details of the first 3 steps. Next steps will be the replications of these 3 steps, with the only change that variables step will have different values.

  • Turribeach
    Turribeach Dataiku DSS Core Designer, Neuron, Dataiku DSS Adv Designer, Registered, Neuron 2023 Posts: 2,024 Neuron

    You can't control the name of the Dashboard PDF export as it takes the name of the Dashboard, but you can rename it after it is exported using the Dataiku API. There isn't a rename file method for Managed folders so you have to download/upload the file and then delete the original one. It's not the most efficient way of doing this but it should work specially since these files shouldn't be too big. Add a new Execute Python code step after each of your export dashboard steps using this sample code:

    import dataiku
    folder = dataiku.Folder("Folder_Name")
    folder.upload_stream("Dashboard_Name_Run1.pdf", folder.get_download_stream("Dashboard_Name.pdf"))
    folder.delete_path("Dashboard_Name.pdf")
    

    You will need to come up with a way to rename your exports with unique names, such as Run1, Run2, RunN…

Setup Info
    Tags
      Help me…