Monday, October 21, 2013

"Parameters" is an invalid Data Connection Name – here's why.

A Parameters Data Connection.

Suppose you've put together a data set that serves as the parameters you need in to analyze your data. Such a data set might be contained in the file Parameters.csv and look like this:
  Parameter,Date,Value
  QWERTY,8/2/2012,1357
  AEIOU,7/32/2012,2468

Now suppose you try and open this data source in Tableau, and that you would, quite naturally, want to name it "Parameters".

You'd open up Tableau's Text File Connection and name your new data connection "Parameters".

No dice.

Tableau won't let you use "Parameters" for your data connection name, and shows you this message:

The message is somewhat unclear. Here are its problems:

  • Data source or data connection?
    "Parameters" was the name we provided in the previous dialog for "the connection", but we're being told here that "Parameters" is the name of an existing data source. Whichever it is, it should be named consistently.
  • Where's "Parameters"? There's no evidence in the UI that any data sources exist, much less one named "Parameters". This is a mystery.
  • Although the message asks politely for another name to be entered, there's no definitive statement that "Parameters" can't be used. (OK, this is picky, but friction comes in little bits.)

Why "Parameters" isn't allowed.

Tableau reserves "Parameters" for internal use as the data source that contains the individual user-created Parameters. It's not clear why Tableau implemented Parameters this way, with the same semantic naming structure as external data sources, whatever name it used for Parameters is necessarily unavailable for end user use as a data connection (source?) name. It's unfortunate that Tableau used "Parameters" instead of a technical name that would be highly unlikely to be used by users.

The evidence: an empty Tableau workbook TWB file (partial):

<?xml version='1.0' encoding='utf-8' ?>
<workbook version='8.1' xmlns:user='http://www.tableausoftware.com/xml/user'>
  <!-- build 8000.13.0319.1225                -->
  <preferences>
  </preferences>
  <datasources>
  </datasources>
  <worksheets>
    <worksheet name='Sheet 1'>
      <table>
        <view>
          <datasources>
          </datasources>
          <aggregation value='true' />
        </view>
        <style>
        </style>
        <panes>
          <pane>
            <view>
              <breakdown value='auto' />
            </view>
            <mark class='Automatic' />
          </pane>
        </panes>
        <rows></rows>
        <cols></cols>
      </table>
    </worksheet>
  </worksheets>

This file was created by saving a newly opened workbook. As we can see in lines #6 & #7, there are no data sources at all in place. If this workbook is closed and then re-opened, the structure will be the same. This brings up the question: if Tableau uses the name "Parameters" for its internal Parameters data source, where is it? Well, Tableau hasn't created it yet, but it reserves the right to "Parameters" for when it will. Which begs the question: when does Tableau create the Parameters internal data source? As far as I can tell, Parameters isn't created until Tableau creates the first parameter, as shown below:

One data source, no Parameters workbook.
This workbook has a single data source open: "Dummy Data.csv". There's no evidence of a Parameters data source.

<?xml version='1.0' encoding='utf-8' ?>
<workbook version='8.1' xmlns:user='http://www.tableausoftware.com/xml/user'>
  <!-- build 8000.13.0319.1225                -->
  <preferences>
  </preferences>
  <datasources>
    <datasource caption='Dummy Data#csv (Dummy Data.csv)' 
                name='csv.41568.014063067130' ... >
      <...>
    </datasource>
  </datasources>

Same workbook with one Parameter created.
This workbook has a single data source open: "Dummy Data.csv", and one parameter—"Parameters" has been created.

<?xml version='1.0' encoding='utf-8' ?>
<workbook version='8.1' xmlns:user='http://www.tableausoftware.com/xml/user'>
  <!-- build 8000.13.0319.1225                -->
  <preferences>
  </preferences>
  <datasources>
    <datasource hasconnection='false'
                inline='true'
                name='Parameters' version='8.1'>
      <aliases enabled='yes' />
      <column caption='Parameter 1'          datatype='real' 
              name='[Parameter 1]'           param-domain-type='any' 
              role='measure'                 type='quantitative' 
              value='1.0000000000000000'>
        <calculation class='tableau' formula='1.0' />
      </column>
    </datasource>
    <datasource caption='Dummy Data#csv (Dummy Data.csv)' 
                name='csv.41568.014063067130' ... >
      <...>
    </datasource>
  </datasources>

More interesting Parameter things.

One of the interesting things that comes out of this exploration are some hints that there's quite a bit of information that we can tell about parameters in the TWB. Which leads into a post or two, or few, in which we'll take a look and see what we can distill out of them.

No comments:

Post a Comment