Function DISPLAY Explained

NOMAD/UltraQuest DISPLAY Function Explained

DISPLAY - Use the DISPLAY function in a DEFINE or expression when you need to modify the data type of a field.

Problem: You have a numeric field called ACCOUNT_TYPE that is 3 digits long, 999, and you want to convert it to an alphanumeric field.

DEFINE ACCOUNT_TYPE_ALPHA as A3 = DISPLAY(ACCOUNT_TYPE);

You can also use the DISPLAY function within other functions such as SUBSTR.

DEFINE ACCOUNT_TYPE_P2 as A1 = SUBSTR(DISPLAY(ACCOUNT_TYPE),2,1);

  • ACCOUNT_TYPE = 25
  • ACCOUNT_TYPE_ALPHA = ‘ 25’
  • ACCOUNT_TYPE_P2 = ‘2’

Problem: You have an alphanumeric field called QUANTITY_SOLD that is defined as an A3 and only contains numbers.  You want to use that field and perform a calculation by taking the value of QUANTITY_SOLD and multiply it by field PRICE that is define as a numeric field.  Because QUANTITY_SOLD is defined as alphanumeric it can’t be used in a calculation.

DEFINE QUANTITY_SOLD_NUM as 999 = DISPLAY(QUANTITY_SOLD);

DEFINE TOTAL_PRICE as 99999.99 = QUANTITY_SOLD_NUM * PRICE;

  • QUANTITY_SOLD = ‘ 25’
  • PRICE = 2.50
  • QUANTITY_SOLD_NUM = 25
  • TOTAL_PRICE = 62.50

Please contact support if you have any additional questions about the DISPLAY function.