Qlik Community

QlikView App Development

Discussion Board for collaboration related to QlikView App Development.

Highlighted
gerrycastellino
Contributor III

Separating out your format masks from calculations

Separating out your  format masks from your calculations, will help  you to organize and control the formats of numbers you are displaying. A change in one central place to your format mask, will update all your display expressions.

1. An Excel/.qvs file will hold the expression calculations,  no formatting using Num function involved here:

     vSum_Sales = sum(Sales)

2. Define variable to hold your format mask as in:

     vFormat_Number = ‘#,##0’

      vFormat_Decimal    = ‘#,##0.0’

     vFormat_Percent  = ‘##0%’

3. In the QV UI, expressions tab use the Num function with one of the formats defined:

     Num(vSum_Sales, vFormat_Number).

     Num(vSum_Sales,vFormat_Decimal).


Gerry.

Tags (1)