HAT 5 Text File Format


Templates Section

Analysis templates are stored in template sections in a HAT text file. HAT stores all templates in a single section, but it is formally correct to use multipile sections as well.

Templates section begins with a section header

##Templates

User defined default values set by "Set Defaults" command in "Analysis" menu are stored using the same format. This section begins with a section header

##Defaults

This document describes how the different templates are stored in the file. Although it is possible to write template definitions externally with a word processor, it is much easier to use HAT's own user interface to define them. This information is provided for advanced users who might use cut-and-paste technique to prepare files with a set of useful templates.



The analysis templates are stored after each other in the file. One empty line separates the template definitions. The first line always begin with a # character. No other definition line begins with that character.

  • Format:
    #{type}	{pathname}
    {selector}
    {selector}
    {selector}
    .............
    
  • Description:
    {type}      Template type specifier. Currently defined types:
                  C   Cards analysis template
                  L   Lines analysis template
                  P   Components analysis template
                  R   Component Functions template
                  T   Time Functions template
                  K   Card format template
    
    {pathname}  Name of the template. Name is a full pathname
                defining its place in template hierarchy.
                Hierarchy levels are separated by a colon (:).
                Default section templates do not have a name.
    
    {selector}  These selectors define the template.
                See appropriate template type definition.
    


Cards Template Selectors

BD{dim}  {expr}        dimension expressions
BC   {from}   {to}     card IDs
BY       {expr}        card title expression
BL       {expr}        line text expression
BV{val}  {expr}        value expressions
BS       {expr}        subset expression

P   {C},{C},{C},...    show columns:

                       {C} =
                          I      card ID
                          P      card date        (HAT 5.5 and later)
                          T      card title
                          L      line text
                          H      file origin      (HAT 5.4 and later)
                          N      notes            (HAT 5.3 and later)
                          S      signatures       (HAT 5.3 and later)
                          D{dim} dimensions
                          V{val} values

D   {decs}{decs}{decs}...    decimals for each value field

N   {NG}{NG}{NG}...    format of negative values for each value field

                       {NG} =                     (HAT 5.7 and later)
                          -   normal
                          R   x±
                          P   (x)

R   {RG}{RG}{RG}...    value color for each value field

                       {RG} =                     (HAT 5.5 and later)
                          -   black
                          R   +black / -red
                          G   +green / -red

S   {GS}{LS}           group and line scope

                       {GS} = {LS} =
                          N   none
                          S   selected
                          A   all

GC                     gridlines between cards    (HAT 5.5 and later)

Y   {dateformat}       format for date field      (HAT 5.5 and later)

T   {comptexts}{comptexts}{comptexts}...

                       dimension component text for each dimension field
                                                  (HAT 5.5 and later)

Q{key}{col}   C{order}   D{dimorder}   T{order}   V{valueorder}

                       sort keys

                       {key} =      key ordinal number (1..8)

                       {col} =
                          I         card ID key
                          P         card date key
                          T         card title key
                          L         line text key
                          D{dim}    dimension key
                          V{val}    value key
                          H         file origin

                       C{order} =      sort order for card ID
                       D{dimorder} =   sort order for dim fields
                       T{order} =      sort order for text fields
                       V{valueorder} = sort order for value fields

                       {order} =
                          A         ascending
                          D         descending

                       note: sorting is available in HAT 5.5 and later

wC  {int}              width of the card ID field
wY  {int}              width of the card title field
wL  {int}              width of the line text field
wV  {int}  {int}  ...  widths of the value fields
wD  {int}  {int}  ...  widths of the dimension fields
wH  {int}              width of the file origin field  (HAT 5.4 and later)

See also generic selectors.



Lines Template Selectors

BD{dim}  {expr}        dimension expressions
BC   {from}   {to}     card IDs
BY       {expr}        card title expression
BL       {expr}        line text expression
BV{val}  {expr}        value expressions
BS       {expr}        subset expression

Q   {val}              value field

D   {decs}{decs}{decs}...    decimals for each value field

N   {NG}{NG}{NG}...    format of negative values for each value field
n   {NG}               format of negative values for accumulated field

                       {NG} =                     (HAT 5.7 and later)
                          -   normal
                          R   x±
                          P   (x)

R   {RG}{RG}{RG}...    value color for each value field
r   {RG}               value color for accumulated field

                       {RG} =                     (HAT 5.5 and later)
                          -   black
                          R   +black / -red
                          G   +green / -red

Gx  {grid}             horizontal gridlines for text
Gy  {vertgrid}         vertical gridlines for text

P   {C},{C},{C},...    show columns:

                       {C} =
                          I      card ID
                          P      card date        (HAT 5.5 and later)
                          T      card title
                          L      line text
                          D{dim} dimensions
                          V{val} values
                          S      accumulated
                          H      file origin      (HAT 5.4 and later)

H   {F}{F}{F}...       header flags:

                       {F} =
                          B   sum before
                          +   sum positive
                          -   sum negative
                          P   sum period
                          F   sum after
                          #   number of lines
                          C   number of cards     (HAT 5.1 and later)
                          A   averages
                          E   median
                          M   max values
                          m   min values
                          T   turnover time
                          R   turnover rate
                          V   variance            (HAT 5.1 and later)
                          D   standard deviation  (HAT 5.1 and later)

+   {percentage}       positive interest
-   {percentage}       negative interest

                       {percentage} = floating point number without %-sign

IL                     linear interest calculation
IE                     exponential interest calculation

WL                     show as line chart
WB                     show as bar chart

wC  {int}  {int}             column widths for card ID and card title
wD  {int}  {int}  {int} ...  column widths for dimensions
wL  {int}  {int}  {int} ...  column widths for line text, value, accumulated
                             and other value fields
wH  {int}                    column width for file origin  (HAT 5.4 and later)

T   {comptexts}{comptexts}{comptexts}...

                       dimension component text for each dimension field
                                                  (HAT 5.5 and later)

S{key}{col}   C{order}   D{dimorder}   T{order}   V{valueorder}

                       sort keys

                       {key} =      key ordinal number (1..8)

                       {col} =
                          I         card ID key
                          P         card date key    (HAT 5.5 and later)
                          T         card title key
                          L         line text key
                          D{dim}    dimension key
                          V{val}    value key
                          H         file origin      (HAT 5.5 and later)

                       C{order} =      sort order for card ID
                       D{dimorder} =   sort order for dim fields
                       T{order} =      sort order for text fields
                       V{valueorder} = sort order for value fields

                       {order} =
                          A         ascending
                          D         descending

                       note: sorting is available in HAT 5.1 and later

ZE                     show exponent on value axis
ZI                     invert value axis direction
ZV                     omit value gridlines
ZD                     omit time gridlines
ZR                     show reference line
ZG                     show today line
ZZ                     show zero line
ZC   {name}            use time scale {name} as time labels
ZS                     omit redundant information in card fields
ZM                     use red/black colors for numbers  (HAT 5.1 and later)
ZN                     use red/green colors for numbers

See also generic selectors.



Components Template Selectors

BD{dim}  {expr}        dimension expressions
BC   {from}   {to}     card IDs
BY       {expr}        card title expression
BL       {expr}        line text expression
BV{val}  {expr}        value expressions
BS       {expr}        subset expression

F   {val}              value field

P   {dim}      {dim}      ...  view dimensions
K   {viewopt}  {viewopt}  ...  component hierarchy, filtering and levels options

                       (only one dimension supported in HAT 5.2.3 and earlier)

D   {decs}             decimals
Gx  {grid}             horizontal gridlines for text
Gy  {vertgrid}         vertical gridlines for text

S   {valueorder}{column}{dimorder}

                       sorting order
                       dimension sort order is available in HAT 5.3 and later

R   {indent}           indentation

VP  {column}           pie column

                       {column} =
                          B   before column
                          N   negative column
                          P   positive column
                          R   period column
                          %   percentage column      (HAT 5.1 and later)
                          K   cards count column     (HAT 5.1 and later)
                          C   lines count column
                          E   at End column
                          A   after column
                          T   total column

%-                     no %-labels around pies
%I                     %-labels with integer values
%D                     %-labels with one decimal

WP                     show pie chart

ZC                     don't draw scale under the pies
ZD                     exclude sublevel values in pie (direct)
ZS                     include sublevel values in pie (summed)
ZX  {expansiondata}    initial component expansion state
ZR                     use right aligned signs for values in pie  (HAT 5.7 and later)
ZP                     use parenthesis for negative values in pie (HAT 5.7 and later)
ZM                     use red/black colors for values in pie
ZN                     use red/green colors for values in pie

wD  {int}              column width for dimension texts

Q{column}  {flags}  {width}   {decs}

                       settings for each column in use

                       {flags} =
                          V   visible
                          v   not visible
                          S   Include sublevels (summed)
                          s   exclude sublevels (direct)
                          n   normal format for negative values
                          x   right aligned sign x±           (HAT 5.7 and later)
                          p   negative values in parenthesis  (HAT 5.7 and later)
                          r   normal black color
                          Q   red/black                       (HAT 5.1 and later)
                          R   red/green                       (HAT 5.1 and later)
                          B   boldface
                          b   not boldface

                       {width}    column width in pixels (integer)

See also generic selectors.



Time Functions Template Selectors

Selection variable selectors:
VN  {name}  {title}    name and title  (must be the first line)
VD{dim}  {expr}        dimension expressions
VC  {from}  {to}       card IDs
VY       {expr}        card title expression
VL       {expr}        line text expression
VV{val}  {expr}        value expressions
VS       {expr}        subset expression
VF       {val}         value field

VM  {combination}{measure}       variable calculation settings

                       {combination} =
                          C   line count
                          K   card count         (HAT 5.1 and later)
                          S   sum
                          s   -sum
                          P   product
                          A   average
                          G   geometric mean
                          D   median
                          T   turnover time      (HAT 5.1.2 and later)
                          R   turnover rate      (HAT 5.1.2 and later)
                          M   maximum
                          N   minimum
                          F   first
                          L   last

                       {measure} =
                          P   by period
                          A   from start

VT  {move}             time offset

                       {move} =
                          x    none time offset
                          Y+   one year forward
                          Y-   one year back
                          Q+   one quarter forward
                          Q-   one quarter back
                          M+   one month forward
                          M-   one month back
                          +{int}{perid}   nr periods forward
                          -{int}{perid}   nr periods back

                       {period} =
                          Y   years
                          M   months
                          W   weeks
                          D   days

VZ  {cp}  {cp}  ...    presentation options:

                       {cp} =
                          D{decs}   decimals
                          C{color}  line or bar color
                          W{int}    column width in pixels
                          w{int}    line width (1 to 6)
                          V+        visible
                          NR        right aligned sign x±           (HAT 5.7 and later)
                          NP        negative values in parenthesis  (HAT 5.7 and later)
                          R+        red/green
                          RB        red/black   (HAT 5.1 and later)
                          B+        boldface
                          S+        totals      (HAT 5.5 and later)

V-                     delete selection
                       used with Modify macro command

Formula variable selectors:
FN  {name}  {title}    name and title  (must be the first line)
FF  {expr}             expression
FD  {timeopr}          operation by time

                       {timeopr} =
                          x   no operation
                          I   integrate
                          D   differentiate
                          M   multiply
                          Q   quontient

FG  {cgr}              curve presentation

                       {cgr} =
                          -   not shown
                          L   line chart
                          B   bar chart

FZ  {cp}  {cp}  ...    presentation options (same structure as in VZ above)

F-                     delete formula
                       used with Modify macro command

Other selectors:
K   {from}  {to}       time axis limits (card IDs)
PL  {period}           period length

                       {period} =
                          Y   years
                          H   half Years
                          T   tertials
                          Q   quarters
                          N   two Months
                          M   months
                          K   half Months
                          4   four Weeks
                          3   three Weeks
                          2   two Weeks
                          W   qeeks
                          D   days
                          A   active Days
                          C   active Cards
                          G   active Groups
                          L   active Lines

PX  {name}             use time scale {name} as the period

PW  {int}              date/cardID column width in pixels

L   {bar}              bar graphics layout

Gx  {grid}             horizontal gridlines for text
Gy  {vertgrid}         vertical gridlines for text

SM  {float}            maximum value for diagram value axis
SN  {float}            minimum value for diagram value axis

SV  {valueorder}   {name}

                       sort lines by variable with name {name}
                                                     (HAT 5.3 and later)

WL                     show diagram (line and bar charts)

ZE                     show exponent on value axis
ZI                     invert value axis direction
ZV                     omit value gridlines
ZD                     omit time gridlines
ZR                     show reference line
ZG                     show today line
ZZ                     show zero line
ZC  {name}             use time scale {name} as time labels
ZT                     show card titles
ZN                     show period end dates only
ZB                     omit "Before" values row      (HAT 5.3 and later)

See also generic selectors.



Component Functions Template Selectors

Selection variable selectors:
VN  {name}  {title}    name and title  (must be the first line)
VD{dim}  {expr}        dimension expressions
VC  {from}  {to}       card IDs
VY       {expr}        card title expression
VL       {expr}        line text expression
VV{val}  {expr}        value expressions
VS       {expr}        subset expression
VF       {val}         value field

VM  {combination}{measure}       variable calculation settings

                       {combination} =
                          C   line count
                          K   card count         (HAT 5.1 and later)
                          c   component count    (HAT 5.1 and later)
                          S   sum
                          s   -sum
                          P   product
                          A   average
                          G   geometric mean
                          D   median
                          T   turnover time      (HAT 5.1.2 and later)
                          R   turnover rate      (HAT 5.1.2 and later)
                          M   maximum
                          N   minimum

                       {measure} =
                          C   by component
                          S   from start

VZ  {cp}  {cp}  ...    presentation options:

                       {cp} =
                          D{decs}   decimals
                          C{color}  bar color
                          W{int}    column width in pixels
                          cD        direct values
                          cS        sums
                          V+        visible
                          NR        right aligned sign x±           (HAT 5.7 and later)
                          NP        negative values in parenthesis  (HAT 5.7 and later)
                          R+        red/green
                          RB        red/black   (HAT 5.1 and later)
                          B+        boldface

V-                     delete selection
                       used with Modify macro command

Formula variable selectors:
FN  {name}  {title}    name and title  (must be the first line)
FF  {expr}             formula expression

FS  {sum}              summing over the dimension hierarchy

                       {sum} =
                          B   before
                          A   after

FZ  {cp}  {cp}  ...    presentation options (same structure as in VZ above)

F-                     delete formula
                       used with Modify macro command

Other selectors:
PD  {dim}      {dim}      ...  view dimensions
K   {viewopt}  {viewopt}  ...  component hierarchy, filtering and levels options

                       (only one dimension supported in HAT 5.2.3 and earlier)

PW  {int}              dimension column width in pixels
R   {indent}           indentation

Gx  {grid}             horizontal gridlines for text
Gy  {vertgrid}         vertical gridlines for text

S   {valueorder}{dimorder}     {name}

                       sort lines by variable with name {name}
                       dimension sort order is available in HAT 5.3 and later

L   {bar}              bar graphics layout

N  {spacing}           line spacing

                       {spacing} =
                          1   1.0
                          A   1.2
                          2   1.5
                          3   2.0
                          4   2.5
                          5   3.0
                          B   4.0
                          C   5.0
                          D   6.0

WR                     show bar chart

ZI                     invert value axis direction
ZV                     omit value gridlines
ZX  {expansiondata}    initial component expansion state

See also generic selectors.



Common definitions

These definitions are used through out in this specification:

{int}    = integer value
{float}  = floating point value

{dim}    = dimension number, 1 to 32
               note: maximum number of dimensions
               16    (HAT 5.0)
               24    (HAT 5.1)
               32    (HAT 5.2 and later)

{val}    = value field identifier, A to X

{decs}   = decimals
           0 to 6   number of decimals
           T        thousands (')
           M        millions  (")
           F        floating  (HAT 5.2 and later)

{dateformat} = format for date  (HAT 5.5 and later)
           S   yymmdd
           T   yyyy.mm.dd
           W   yyyy-mm-dd
           F   dd.mm.yy
           G   dd.mm.yyyy
           H   d.m.yyyy
           U   mm/dd/yy
           V   mm/dd/yyyy

{viewopt} = {hierarchy}{compfilter}{complevels}{compcolors}{comptexts}

           component hierarchy, filtering and level limit
           for a dimension view axis

{hierarchy} = component hierarchy
           H   hierarchical
           F   flat

{compfilter} = component filtering
           A   all
           U   active, in use
           Z   non-zero

{complevels} = component level limit  (HAT 5.3 and later)
           A   all levels
           1   only the first level
           2   up to level 2
           3   up to level 3
           4   up to level 4
           5   up to level 5
           6   up to level 6
           7   up to level 7
           8   up to level 8

{compcolors} = component colors  (HAT 5.3.2 and later)
           B   black
           5   gray
           N   brown
           U   blue
           D   dark blue
           M   magenta
           O   orange
           R   red
           V   violet
           G   green

{comptexts} = component texts  (HAT 5.5 and later)
           -   default
           H   HAT-Code
           C   Host-Code
           T   Text
           N   HAT-Code Text
           M   Host-Code Text
           P   HAT-Code Host-Code
           R   HAT-Code Host-Code Text

{indent} = hierarchy indent
           F   flat, no indent
           S   single
           D   double

{expansiondata} = initial expansion state
           |        close all
           \        expand all
           |K|      expand K
           \K\      expand all but K
           -x{int}  expand to level {int}, {int} >= 0      (HAT 5.4 and later)
           -w{int}  expand to view {int}, {int} = 1 to 4   (HAT 5.4 and later)

{grid}   = horizontal gridlines
           -   none
           1   every line
           2   every other line
           3   every third line
           5   every fifth line
           X   every tenth line

{vertgrid} = vertical gridlines
           -   no
           +   yes

{valueorder} = sorting order for values
           D   descending
           E   combined descending
           F   absolute descending
           C   absolute ascending
           B   combined ascending
           A   ascending

{dimorder} = sorting order for dimension components
           N   normal
           R   reversed
           C   HAT-code    (HAT 5.3 and later)
           T   text
           H   host code

{bar} = bar graphics layout
           U   unique bars
           T   tiled bars
           B   behind each other
           O   overlayed bars
           S   stacked bars

{color}  = color
           -   white
           2   gray 25 %
           5   gray 50 %
           7   gray 75 %
           B   black
           N   brown
           O   orange       (HAT 5.2.1 and later)
           R   red
           P   pink         (HAT 5.2.1 and later)
           M   magenta
           V   violet
           Y   yellow
           L   light green
           G   green
           C   cyan
           U   blue
           D   dark blue

{encoding} = character encoding     (HAT 5.6 and later)
           UTF-8        Variable length Unicode encoding
           UTF-16LE     Two byte little endian (Intel) Unicode encoding
           UTF-16BE     Two byte big endian (PowerPC) Unicode encoding
           SysPage      System default 8-bit codepage
           MacRoman     Macintosh default codepage
           MacRomanCE   Macintosh Central European codepage
           ISO-8859-1   Windows default codepage (ANSI character set)
           ISO-8859-2   Windows Central European codepage
           PC-8         DOS OEM Character set

{weblang} = language setting for a web client
           US   English
           SWE  Swedish
           FIN  Finnish


Generic Selectors

Selectors beginning with s define local subsets.

Selectors beginning with x are common to all templates:

xo                     open this template when database is opened
xc                     calculate when opening this template
xz                     set window size according to its contents
xw                     don't show on web                  (HAT 5.5 and later)

xP  {int}  {int}       window position  (top, left)
xS  {int}  {int}       window size  (height, width)

xE  {int}              window header height (integer)
xM  {int}              window page panel width (integer)

xLm {data}             page setup record (for macintosh)
xLw {data}             page setup record (for windows)

xpt                    don't print window title
xpu                    don't print printing time
xpm                    print variable definitions
xpn                    print analysis notes
xpc                    don't print column titles
xpd                    don't print header rows
xpa                    don't print data rows
xph                    print leaving margin for holes

xpp  {pagenumber}      print page number

                       {pagenumber} =
                          -   no page numbers
                          a   n        n = current page number
                          s   n/t      t = total number of pages
                          p   n(t)

xeE  {encoding}        export text encoding               (HAT 5.6 and later)
xew                    export text in HTML
xex                    export text in XML

xec  {creator}         text export creator          (mac HAT 5.5 and earlier)
xet                    export window title
xee                    export variable definitions
xes                    export analysis notes
xer                    export column titles
xeh                    don't export header rows
xea                    don't export data rows

xed  {sepchar}         export using decimal separator
xem  {sepchar}         export using thousand separator
xef  {sepchar}         export using field separator
xeq  {sepchar}         export using quoted fields
xen  {sepchar}         export using row terminator

                       {sepchar} =
                          {char}     actual non-control character
                          #{int}     ASCII code for a control character
                          #F         CR/LF row terminator
                          #B         padding character (non-breaking space)

xek                    exclude quotation marks
xel                    export column widths in HTML
xeu                    multiple columns for stacked dimensions
                                                          (HAT 5.4 and later)
xe&                    use HTML entity names for characters codes 128-255
                                                          (HAT 5.1 and later)

xep  {creator}         picture export creator       (mac HAT 5.5 and earlier)
xeg  {filetype}        picture export file type     (mac HAT 5.5 and earlier)
xeW  {int}             picture export width
xeH  {int}             picture export height

xtna                   numeric area tool                  (HAT 5.6 and later)
xtnh                   numeric hair tool                  (HAT 5.6 and later)

xtg+                   graphic magnifier tool             (HAT 5.6 and later)
xtg-                   graphic inverted magnifier tool    (HAT 5.6 and later)
xtgh                   graphic hair tool                  (HAT 5.6 and later)

xN  {notes}            analysis template notes


Previous Contents