A table's Owner can add new columns to the data, such as to track reference notes or dates. To help clarify a column's intent, you can also manage its name and description as necessary.
Note: To save details your organization routinely tracks about data, such as Version or Data Source, a workspace owner can set up tags for datasets.
Add a column to a table
- From Wdata Home , open the table.
- To add a new column to the bottom of the table, click Add Column .
- To help provide context for the column's data, enter its name and description.
- To help identify the column during mapping, enter its ID, such as
acct_id
oramount
. Keep the ID concise and generic, with no spaces or special characters. - Under Column Type, select the type of data to track in the column.
Type Data Text Any combination of letters, numbers, or symbols, such as for descriptions and names. In a query's Structured Query Language (SQL), this data resolves to VARCHAR
.Integer A whole number—not a fraction or decimal—that can be positive, negative, or 0. Recommended for head count, years, or months. Decimal A number that can contain decimal values, such as 4.344
. Recommended for currency, rates, or inventory units. In a query's SQL, this data resolves toDOUBLE
.Boolean A value of either TRUE
orFALSE
.Timestamp A date with a time value. By default, in the ISO 8601 format. Date A date without a time value. By default, in the ISO 8601 format of YYYY-MM-dd
.Tip: Track months or years as integers rather than text. For example, when you record months as their integer (1-12) instead of their name as text (January-December), you can apply calculations to the data.
- Under Import Format, select the format of imported dates, timestamps, and decimal values:
- For a Date or Timestamp column, select how its values appear. By default, the table uses the ISO 8601 format.
- For a Decimal column, select the format with the thousands and decimal separators to use.
- For a dimension table, select Key for the column with a unique identifier—such as
ID
—to prevent duplicates when adding datasets. To combine multiple values into a unique identifier, select Key for their columns.Note: To mark a Key column, you may need to first edit the table's column IDs to non-numeric values.
- Verify the column's details, and click Save .
Note: At a minimum, verify the column's ID and type before you click Save. To ensure the integrity of connected data, you can delete columns or edit their IDs or types only when the table has no imported datasets.
Select a dimension table's key columns
To prevent duplicates when adding datasets to a dimension table, select Key for the column with a unique value—such as ID—for each record. For a composite unique identifier, select multiple columns as key.
To mark a column as key:
- The table's datasets must be staged. To return an imported dataset to Staged , select Unimport from its menu on the Datasets panel.
- The table's column IDs must be non-numeric. If necessary, edit the column IDs to non-numeric values.
- The table must be a dimension table. To convert a fact table to a dimension table, edit its type.
When you include a dimension table in a query, its key columns are identified as Key in the Sources left panel. Use this indicator to help identify unique dimensions when joining the table with another source as part of a query relationship.
Format a date or timestamp column
Note: To ensure the integrity of connected data, you can only edit the format of a date or timestamp column when all datasets are Staged . To stage an imported dataset, select Unimport from its menu on the Datasets right panel.
By default, a date or timestamp column uses the ISO 8601 format of YYYY-MM-dd
or yyyy-MM-dd'T'HH:mm:ss.SSSz
. To have a date or timestamp column display its data differently, under Import format, select the format to use.
To create your own format, select Custom, and enter the pattern using these SimpleDateFormat characters in the order their values should appear:
Character | Date value |
---|---|
G |
Era, BC (before Christ) or AD (anno domini) |
y |
Year. Use yy for two-digits (21) or yyyy for four (2021). |
M |
Month:
|
d |
Day of the month. To include a leading zero on single-digit days, use dd . |
h |
Hour of the day with a 12-hour clock, 1 to 12. Typically used as two digits, hh . For 0-11, use K . |
H |
Hour of the day with a 24-hour clock, 0 to 23. Typically used as two digits, HH . For 1-24, use k . |
m |
Minute of the hour, 0-59. Typically used as two digits, mm . |
s |
Second of the minute, 0-59. Typically used as two digits, ss . |
S |
Millisecond of the second, 0-59. Typically used as two digits, SS . |
E |
Day of the week:
|
D |
Day in the year, 1-366 |
F |
Day of the week in the month, such as 1st Thursday in May |
w |
Week in the year, 1-53 |
W |
Week in the month, 0-5 |
a |
Ante or post meridiem, AM or PM |
k |
Hour of the day with a 24-hour clock, 1-24. For 0-23, use HH . |
K |
Hour of the day with a 12-hour clock, 0-11. For 1-12, use hh . |
z |
Time zone |
' |
Escape for a time delimiter, or a single quote |
Note: Characters other than these appear as normal text in the formatted data.
For example, timestamps with a format of EEEEE MMMMM yyyy HH:mm:ss.SSSZ
would appear as Saturday September 2021 10:45:42.720+0100.
Edit a column's name or description
To update the name or description of a column, open the table, edit the column's details as necessary, and click Save .
Edit a column's ID or data type
Note: To ensure the integrity of connected data, you can only edit a column's ID or data type when all datasets are Staged .
- From the Datasets right panel of the table, select Unimport from the menu of any imported dataset.
- Edit the column's ID or data type as necessary.
- Click Save .
- Review the edits to the columns, and click Commit changes.
- To reimport a staged dataset, select Import from its menu on the Datasets right panel.
Arrange columns within a table
Note: To ensure the integrity of connected data, you can only move a column when all datasets are Staged .
- From the Datasets right panel of the table, select Unimport from the menu of any imported dataset.
- To move a column, select Move to Top , Move Up , Move Down , or Move to Bottom .
- After you arrange all columns, click Save .
Delete a column from a table
Note: To ensure the integrity of connected data, you can only delete a column when all datasets are Staged .
- From the Datasets right panel of the table, select Unimport from the menu of any imported dataset.
- To delete a column, select Delete from its menu.
- Click Save .
- Review the edits to the columns, and click Commit changes.
- To reimport a staged dataset, select Import from its menu on the Datasets right panel.