tableau / document-api-python

Create and modify Tableau workbook and datasource files
https://tableau.github.io/document-api-python/
MIT License
326 stars 178 forks source link

Insert a Group of data - feature request #208

Open MagnusVortex opened 2 years ago

MagnusVortex commented 2 years ago

I've got a strong use-case for the ability to insert a group of a particular column of my data. There does not appear to be a way to do this currently other than hacking the XML. This would enable an easy way to interactively redraw Sales Territory borders, but starting with the current territories rather than a blank slate.

Something like this:

  <column datatype="string" name="[Cust Group by Territory]" role="dimension" type="nominal">
    <calculation class="categorical-bin" column="[Customer ID]" default="&quot;Other&quot;" new-bin="true">
      <bin default-name="false" value="&quot;NorthNYC&quot;">
        <value>"34942825"</value>
        <value>"93347600"</value>
        </bin>
      <bin default-name="false" value="&quot;SouthNYC&quot;">
        <value>"34944166"</value>
        <value>"34941834"</value>
        <value>"52386700"</value>
        </bin>
      </calculation>
    </column>
jacalata commented 2 years ago

Not sure how I missed this request. I'm not entirely clear on what is being asked for - a before/after version of the xml would be helpful. I will try and look into it more myself as well, but not soon.