Couchbase Analytics Tabular Views
- how-to
Create Tabular Analytics Views (TAVs) from Couchbase datasets for use with Tableau.
Tableau requires data sources to be in tabular form and accessible through SQL. To meet this requirement, Couchbase provides Tabular Analytics Views (TAVs).
A TAV is a type of analytics view that enables Couchbase to interact with software tools designed for relational databases. TAVs present data as a table with uniform rows and columns and a well-defined schema.
To prepare tabular analytics views for Enterprise Analytics, see Tabular Analytics Views.
The following example shows how to create a TAV.
Step 1: Load the Sample Bucket
This example uses the travel-sample bucket, which comes with predefined Analytics collections and tabular views.
To load the bucket:
-
Open the Enterprise Analytics Web Console.
-
Go to .
-
Select
travel-sample. -
Click Load Sample Data.
Step 2: Create a Tabular Analytics View
While the travel-sample dataset includes default Tabular Analytics Views (TAVs), you can also create custom ones.
To create a TAV:
-
Open Enterprise Analytics Web Console and go to Workbench.
-
In the Query Editor, set the scope to
travel-sample.inventory. -
Run the following statement in the Query Editor.
CREATE OR REPLACE ANALYTICS VIEW airline_custom_view ( id STRING, name STRING, iata STRING, callsign STRING, country STRING ) DEFAULT NULL PRIMARY KEY (id) NOT ENFORCED AS SELECT meta().id AS id, name, iata, callsign, country FROM airline;This statement creates a TAV named
airline_custom_viewin thetravel-sample.inventoryscope. The view includes theid,name,iata,callsign, andcountryfields from theairlinecollection.
Step 3: Verify Analytics Collections and Tabular Views
Before connecting to Tableau, verify that your Analytics collections and tabular views are available.
-
Open Enterprise Analytics Web Console and go to Workbench.
-
In the right-hand pane, confirm that the default and custom views appear in the Databases list.