Data type prefixes

Data type prefixes are added to field names in the first data record. Use the prefixes to set field data types in CSV.

The following prefixes are available:

NameDescription
-Numbers.
+Strings.
d+Dates divided into 3 subfields: Year, Month, Day.
ds+Dates displayed in the "dd/MM/yyyy" format.
D+Dates represented as the multilevel hierarchy: Year > Month > Day.
D4+Dates represented as the multilevel hierarchy: Year > Quarter > Month > Day.
dt+Dates displayed in the "dd/MM/yyyy HH:mm:ss" format.
t+Time intervals displayed in the "HH:mm:ss" format.
m+Months. Natural sorting is applied to field members.
w+Days of the week. Natural sorting is applied to field members.

Examples

1) Here is a sample CSV data where the ds+ and w+ prefixes are added to the field names:

ds+Invoice Date, Quantity, Country, w+Week Day
2018-05-15, 3, France, Tuesday
2018-05-16, 4, Italy, Wednesday
2018-05-17, 2, Spain, Thursday
2018-05-12, 2, Japan, Saturday

After loading the CSV data and selecting fields in the Field List, you can see that the Invoice Date is displayed as a string in the "dd/MM/yyyy" format, and the Week Day is interpreted as a day of the week:

2) You can represent a date as a multilevel hierarchy using the D+ or the D4+ prefix.

Here is an example with the D+ prefix:

D+Invoice Date, -Quantity, -Price, +Country
2018-05-15, 3, 329, France
2018-05-16, 4, 139, Italy
2018-05-17, 2, 429, Spain
2018-05-12, 2, 559, Japan

See how the Invoice Date is displayed in the pivot table when the CSV file is loaded to WebDataRocks:

This demo is also available on our CodePen.

To create multilevel hierarchies from fields of other types, use the JSON data source.

See also