Display formats
Display formats control how values are displayed within columns in the 1010data Insights Platform.
Syntax
The syntax for using display formats is:
[type:value;] [width:value;] [padwith:value;] [padto:value;] [dec:value;] [locale:value;] [numgroups:value]
where the value for each parameter is as follows:
parameter | value |
---|---|
type |
Any Display format listed in the tables below (e.g., nocommas ,
monthshort4y ) |
width |
The number of characters to display in the column. Valid values are 1 through 100. If the
contents of a cell exceeds the specified width, the value is truncated. In this
case, the number of visible characters is reduced by two, and " |
padwith |
Used with numeric display formats (num ,
commas , pct , currency ) and
text formats (char ) to specify that the displayed value should be
filled or "padded" out to the column width with a particular character or
sequence.When using Note: padwith
does not work with date+time formats. |
padto |
Used with numeric display formats (num ,
commas , pct , currency ) and
text formats (char ) to specify padding that is fewer characters
than the full column width. A negative value for padto specifies
padding on the right. (Available as of version
18.12)Note: padto does not work with
date+time formats. |
dec |
The number of decimal places to show (valid values are 0 through 15) Note: For integer values, a decimal point and that many 0's will be appended to
the integer. The
dec parameter does not affect text
values. |
locale |
Used to modify the display behavior for numeric, date, and
date+time values, overriding user preferences. Valid values
are as follows:
Other locale specifications may be added in the future. (Available as of version 18.12) |
numgroups |
Used to specify alternate groupings of digits in numbers. Valid values are as
follows:
|
A single type
, width
, or dec
format may
each be applied to a particular column.
format="type:num;type:char;width:3"
,
it will be changed to
format="type:num;width:3"
when the
query is submitted.Examples
The secs(X)
function returns the number
of seconds since midnight for the time given as input. With no display format applied, a
computed column using this function would use the default display format,
num
, and show values like 54,163 and
49,525.
nocommas
display
format:<willbe name="secsexample" value="secs(thistime)" label="Secs since`midnight" format="type:nocommas"/>
Those
same values would now be displayed as
54163 and
49525.<willbe name="margin" value="sales-cost" label="Margin" format="type:num;dec:2"/>
To pad the value 1234 the full width of a column with leading zeros, use the
padwith
option:
<willbe name="foo" value="1234" format="type:nocommas;width:8;padwith:0"/>
Integer display format
The following display format can be applied to values with the integer data type:
Display format | Example value | Displayed value | Notes |
---|---|---|---|
months
(Available as of version 18.12) |
26 | 2 yrs 2 mons | Integer is construed as a year-to-month interval representing a whole number of months and displayed as years and months. |
Number display formats
The following display formats can be applied to values with the integer or decimal data type:
Display format | Example value | Displayed value | Notes |
---|---|---|---|
num |
1234567.89 | 1,234,567.89 | |
nocommas |
11,121,314.15 | 11121314.15 | |
pct |
0.9583 | 95.83% | |
days (Available as of version
18.12) |
2.456 | 2 days 10:56:38 | The dec: option specifies the number of digits shown after
the decimal place for seconds. |
Currency display formats
unit:[VALUE]
, where the
[VALUE]
is a valid ISO 4217 currency letter code, as
shown below:format="type:currency;width:10;unit:EUR"
Full format | Shortened format |
---|---|
format="type:currency;unit:GBP" |
format="type:currency_gbp" |
format="type:currency;unit:EUR" |
format="type:currency_eur" |
For the full list of currency codes, see Currency codes (ISO 4217).
The default value if no code is provided is USD
. The number of decimal places
shown by default is determined by the standard for the particular
currency code used. If a value is provided to the
dec
property, that value will override the
default for that currency.
Currency display formats can be applied to columns of integer or decimal type:
Display format | Example unit value |
Example value | Displayed value |
---|---|---|---|
currency |
EUR |
123456.789 | €123,456.79 |
Date display formats
The following display formats can be applied to integers in the date form (YYYYMMDD):
Display format | Example value | Displayed value |
---|---|---|
date |
19981015 | 10/15/98 |
date4y |
19981015 | 10/15/1998 |
ansidate |
19981015 | 1998-10-15 |
Month display formats
The following display formats can be applied to integers in the month form (YYYYMM):
Display format | Example value | Displayed value |
---|---|---|
month |
200310 | 10/03 |
month4y |
200310 | 10/2003 |
monthshort |
200310 | Oct03 |
monthshort4y |
200310 | Oct2003 |
monthshortdash |
200310 | Oct-03 |
monthshortdash4y |
200310 | Oct-2003 |
monthlong |
200310 | October03 |
monthlong4y |
200310 | October2003 |
monthlongdash |
200310 | October-03 |
monthlongdash4y |
200310 | October-2003 |
Quarter display formats
The following display formats can be applied to integers in the quarter form (YYYYQ):
Display format | Example value | Displayed value |
---|---|---|
quarter |
20032 | 2Q03 |
quarter4y |
20032 | 2Q2003 |
Time display formats
The following display formats can be applied to integers in the time form (HHMMSS):
Display format | Example value | Displayed value | Notes |
---|---|---|---|
hms24 |
224556 | 22:45:56 | |
hms12 |
224556 | 10:45:56p | |
hm24 |
224556 | 22:46 | The time is rounded to the nearest minute. |
hm12 |
224556 | 10:46p | The time is rounded to the nearest minute. |
Date+Time display formats
The following display formats can be applied to values with the decimal data type in the date+time form (XXXX.YYYYYYYYYYY):
Display format | Example value | Displayed value |
---|---|---|
datehms24 |
-6906.38540509259 | 02/03/16_14:45:01 |
datehms12 (Available as of version
18.12) |
-6906.38540509259 | 02/03/16_02:45:01p |
date4yhms24
(Available as of version 18.12) |
-6906.38540509259 | 02/03/2016_14:45:01 |
date4yhms12 (Available as of version
18.12) |
-6906.38540509259 | 02/03/2016_02:45:01p |
ansidatetime |
-6906.38540509259 | 2016-02-03 14:45:01 |
Text display formats
The following display format can be applied to text:
Display format | Example value | Displayed value | Notes |
---|---|---|---|
char |
10/15/98 | 10/15/98 | |
url |
www.1010data.com | www.1010data.com | Creates an http: link of
the text. If the text is not a valid URL, the
behavior is unexpected. |
email |
info@1010data.com | info@1010data.com | Creates a mailto: link of
the text. If the text is not a valid email
address, the behavior is unexpected. |
months |
24 | 2 yrs 0 mos |