Results 1 to 7 of 7

Thread: Deleting Multiple Scenarios

  1. #1

    Join Date
    Aug 2013
    Posts
    22

    Deleting Multiple Scenarios

    Is there a way to delete multiple scenarios? Possibly in SQL?!

  2. #2
    Senior Member

    Innovyze Employee



    Join Date
    Feb 2013
    Posts
    146
    Hello,
    There is a blog about adding scenarios using SQL, maybe thiswill help you.
    Regards,
    Robert Dickinson

    http://blog.innovyze.com/2018/01/16/...ct-parameters/

  3. #3

    Join Date
    Aug 2013
    Posts
    22
    Thanks for the article. I am familiar with it and it is a useful tool for sensitivity analysis and uncertainty modeling.

    However, I am more interested in something along the lines of...

    LET $ScenarioNames = ALL.SCENARIOS.EXCEPT.BASE;
    DROP SCENARIO $ScenarioNames;

  4. #4
    Forum Moderator

    Innovyze Employee



    Join Date
    Feb 2013
    Posts
    133
    The following is one approach although you would need to define the scenarios to be deleted in the query.

    LIST $scenariostobedeleted = 'Scenario1','Scenario2','Scenario3','Scenario4','S cenario5','Scenario6';
    LET $n = 1;
    WHILE $n<=LEN($scenariostobedeleted);
    LET $selectedscenario = AREF($n,$scenariostobedeleted);
    DROP SCENARIO $selectedscenario;
    LET $n=$n+1;
    WEND

  5. #5

    Join Date
    Aug 2013
    Posts
    22
    Is there a way to export the scenario names? or definite a variable as a list of all scenarios?

  6. #6
    Forum Moderator

    Innovyze Employee



    Join Date
    Feb 2013
    Posts
    133
    Not that I can work out. It might be possible to do this with Ruby scripting. If you email support@innovyze.com with your licence number then I can take a look into this further as part of a support request.

  7. #7

    Join Date
    Aug 2013
    Posts
    22
    Thanks Duncan! Your blog post was helpful (http://blog.innovyze.com/2018/05/22/...-base-network/).

    Is there a way to modify the script such that, if a scenario is older than a date, say 18 months, then delete it?


    Any plans on leading a Ruby webinar?!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •