3 Replies Latest reply on May 5, 2018 9:38 PM by Paul Lu

    How to bulk add parameters

    Paul Lu

      I was having trouble adding 100s of parameters I already have in excel / csv, so I invented this little hack to add parameters at bulk before Tableau officially release new features to support bulk adding of parameters.

       

      Step 0. Backup your workbook (just in case something goes terribly wrong from here onwards), and delete all your parameters.

      Step 1. Create a new parameter in your workbook, name it something unique and easy to search for, such as ParameterXYZ.

      Step 2. Open your workbook in text editor, such as Ultraedit or BBEdit, or just ordinary editor, and search for ParameterXYZ, and locate the following section:

       

          <datasource hasconnection='false' inline='true' name='Parameters' version='10.4'>

            <aliases enabled='yes' />

            <column caption='ParameterXYZ' datatype='real' name='[Parameter 1]' param-domain-type='any' role='measure' type='quantitative' value='1.0'>

              <calculation class='tableau' formula='1.0' />

            </column>

          </datasource>

       

      Step 3. Open up the attached Parameter Generator, copy and paste your Constant name / value into A & B Col respectively to generate the replacement Parameter xml section.

      Step 4. Copy content of D Col to a fresh new text editor, remove double quote (from excel conversion back to text?) & trailing garbage characters if any.

      Step 5. Paste it back to your workbook which you opened with text editor, replacing the Parameter datasource section, save & exit.

      Step 6. Open up your workbook and you should see the newly added Parameter ready for use.