Renaming analytics and scripts

You can use the script editor to rename individual analytics or scripts if you have “Full permissions” for the analysis app or Analytics project. Names must be unique within the project. Using the script editor, you can rename both an analytic’s name, specified in the analytic header, and its script name, which appears in the script editor’s Project Explorer. When you rename an analytic in the treeview, you can rename only the analytic’s name.

Note:

Exercise care when renaming scripts. If script dependencies exist, renaming a script without updating the name wherever the script is referenced can cause other scripts or analytics to fail.

To rename an analytic or script:

  1. Select the analytic, or the analysis app or Analytics project containing the analytic or script, you want to rename.
    Tip:

    For analysis apps containing multiple analytics, select the analysis app if you want the script editor to automatically open all the analytics in the analysis app.

  2. Do one of the following:

    Select File > Edit Scripts.

    Right-click and select Edit Scripts.

    The script editor opens.

  3. If you want to rename an analytic script name, or a script, in the Project Explorer select the appropriate analytic or script and do the following:
    1. Select File > Rename, or right-click and select Rename.

      The name is highlighted as editable text.

      Note:

      Analytic script names appear in the Project Explorer. Analytic names appear in the analytic header at the top of the analytic script itself.

    2. Type the new name for the analytic script, or script, and press Enter.

      Spaces and special characters are invalid in script names and are automatically replaced by the underscore character (_).

  4. If you want to rename an analytic name, do the following:
    1. If you have just renamed the analytic script name, and you do not want to replace the existing analytic, or delete its input values and schedules, click Save All.

      If you change both an analytic’s script name and its name prior to clicking Save All, the existing analytic is replaced by the renamed analytic, and the existing input values and schedules are deleted. If you intend to replace the existing analytic, do not click Save All at this point. For more information, see Options when renaming analytics.

    2. If necessary, double-click the analytic in the Project Explorer to open it, or to switch the focus to the appropriate tab.
    3. Modify the name that appears after the ANALYTIC tag.

      For example: //ANALYTIC <new name>

      Caution

      Characters that cannot be used in Windows filenames (< > : “ / \ | ? *) should not be used in analytic names, because they will cause an error that prevents the export of analytic results.

  5. Click Save All .
  6. If you are replacing an existing analytic, click OK in the Analytic Removed dialog box.

    The existing analytic is replaced by the renamed analytic, and the existing input values and schedules are deleted.

  7. Select File > Exit to close the script editor.