Skip to main content Skip to complementary content

FieldAttributes Class

Namespace: Qlik.Engine
Assembly: Qlik.Engine.dll

Sets the formatting of a field.

The properties of qFieldAttributes and the formatting mechanism are described below.

Formatting mechanism

The formatting mechanism depends on the type set in qType, as shown below:

Type is DATE, TIME, TIMESTAMP or INTERVAL

The following applies:

  • If a format pattern is defined in qFmt , the formatting is as defined in qFmt .
  • If qFmt is empty, the formatting is defined by the number interpretation variables included at the top of the script ( TimeFormat , DateFormat , TimeStampFormat ).
  • The properties qDec , qThou , qnDec , qUseThou are not used.
  • If a format pattern is defined in qFmt , the engine looks at the values set in qDec and qThou . If these properties are not defined, the formatting mechanism uses the number interpretation variables included at the top of the script ( DecimalSep and ThousandSep ).
  • If no format pattern is defined in qFmt , no formatting is applied. The properties qDec , qThou , qnDec , qUseThou and the number interpretation variables defined in the script are not used .
  • If a format pattern is defined in qFmt , the engine looks at the values set in qDec and qThou . If these properties are not defined, the engine uses the number interpretation variables included at the top of the script ( DecimalSep and ThousandSep ).
  • If no format pattern is defined in qFmt , and if the value is almost an integer value (for example, 14,000012), the value is formatted as an integer. The properties qDec , qThou , qnDec , qUseThou are not used.
  • If no format pattern is defined in qFmt , and if qnDec is defined and not 0, the property qDec is used. If qDec is not defined, the variable DecimalSep defined at the top of the script is used.
  • If no format pattern is defined in qFmt , and if qnDec is 0, the number of decimals is 14 and the property qDec is used. If qDec is not defined, the variable DecimalSep defined at the top of the script is used.
  • If a format pattern is defined in qFmt , the engine looks at the values set in qDec and qThou . If these properties are not defined, the engine uses the number interpretation variables included at the top of the script ( DecimalSep and ThousandSep ).
  • If no format pattern is defined in qFmt , the properties qDec and qnDec are used. If qDec is not defined, the variable DecimalSep defined at the top of the script is used.
  • If a format pattern is defined in qFmt , the engine looks at the values set in qDec and qThou . If these properties are not defined, the engine uses the number interpretation variables included at the top of any script ( MoneyDecimalSep and MoneyThousandSep ).
  • If no format pattern is defined in qFmt , the engine uses the number interpretation variables included at the top of the script ( MoneyDecimalSep and MoneyThousandSep ).

Type is INTEGER

The following applies:

Type is REAL

The following applies:

Type is FIX

The following applies:

Type is MONEY

The following applies:

Type is ASCII

No formatting, qFmt is ignored.

Inheritance

  • System.Object
    • FieldAttributes

Syntax

[ValueClass]
public class FieldAttributes : IFieldAttributes

Constructors

Name Description
FieldAttributes()

Properties

Name Description
Dec

Defines the decimal separator.

Example: .

JSON property name: qDec

Fmt

Defines the format pattern that applies to qText .

Is used in connection to the type of the field (parameter qType ).

For more information, see Formatting mechanism.

Example: YYYY-MM-DD for a date.

JSON property name: qFmt

nDec

Number of decimals.

Default is 10.

JSON property name: qnDec

Thou

Defines the thousand separator (if any).

Is used if qUseThou is set to 1.

Example: ,

JSON property name: qThou

Type

Type of the field.

Default is U.

JSON property name: qType

UseThou

Defines whether or not a thousands separator must be used.

Default is 0.

JSON property name: qUseThou

Did this page help you?

If you find any issues with this page or its content – a typo, a missing step, or a technical error – let us know how we can improve!