How to fetch a dummy column in TIBCO Spotfire using Information Designer.

How to fetch a dummy column in TIBCO Spotfire using Information Designer.

book

Article ID: KB0079117

calendar_today

Updated On:

Products Versions
Spotfire Analyst All versions

Description

In relational databases, SQL queries like "Select 1 from <table>" or "Select <column_name>, 'dummy_value' from <table>" are quite common (See reference [1] for use cases). Here, the data value 'selected' from the table (e.g. 1) is not actually present in the underlying data and the query just returns an additional "dummy" column with the supplied "dummy" data value for every row in the underlying table. 

The SQL query fired by the Information Designer in TIBCO Spotfire can be modified to select a dummy column from the database, but this would need appropriate column handling. The below resolution can be followed to achieve this.

Issue/Introduction

How to fetch a dummy column in TIBCO Spotfire using Information Designer.

Environment

All supported OS versions

Resolution

While creating an Information link, we are basically firing a select SQL query to the database. The columns returned by the Database are handled by the column elements defined for the information link. So in order to fetch a dummy column, we would first need to create a column element for it which will serve as a placeholder for the dummy data.

-    To create a dummy column element, we can duplicate an existing column element from the same table/view. Right click an existing column element (of the same data type as of the dummy data) >> Edit. Click ‘Save As’ and give a name to the dummy column.

-    Now Edit the Information link, and add this dummy column element. Information link should look like below:

User-added image

-    Now click on the ‘SQL…’ button at the bottom to open the ‘Edit SQL’ dialog box. Here you can modify the SQL and supply the dummy data value to the dummy column. See screenshot below:

User-added image

-     If you want to fetch only the dummy column, create a new information link and add the previously created dummy column element(s) in it and then modify the SQL accordingly.

NOTE: The number of columns elements in the Information Designer must equal the number of columns specified in the SQL.

In this case, the Information link should look like this:

User-added image

-    This should fetch the dummy data value for every row in the underlying data table.

Additional Information

[1] What does it mean by select 1 from table? - https://stackoverflow.com/questions/7171041/what-does-it-mean-by-select-1-from-table