Table of Contents

Search

  1. Preface
  2. Introduction to Data Validation Option
  3. New Features and Behavior Changes
  4. Repositories
  5. XML Data Source
  6. Tests for XML Data Sources
  7. Connections
  8. Expressions
  9. Table Pairs
  10. Tests for Table Pairs
  11. Single-Table Constraints
  12. Tests for Single-Table Constraints
  13. Examples of Tests from Spreadsheets
  14. SQL Views
  15. Lookup Views
  16. Join Views
  17. Aggregate Views
  18. Business Intelligence and Reporting Tools Reports
  19. Dashboards
  20. DVOCmd Command Line Program
  21. Troubleshooting
  22. Datatype Reference
  23. Reporting Views
  24. Metadata Import Syntax
  25. Jasper Reports
  26. Glossary

Data Validation Option User Guide

Data Validation Option User Guide

Expression Examples

Expression Examples

The sample field expressions show how to use PowerCenter functions to create expressions.
The following examples show how to use field expressions when comparing column values:
Concatenation example
You want to compare the full names in two tables. One table has a FULL_NAME column where the full names are in uppercase letters. The other table has FIRST_NAME and LAST_NAME columns where the first and last names are in lowercase letters. To compare the full names, you must concatenate the FIRST_NAME and LAST_NAME columns, and convert the lowercase names to uppercase.
To compare the full names, you create a Value test and specify the following expressions for the table columns:
  • Field A:
    FULL_NAME
  • Expression B:
    UPPER(FIRST_NAME || ' ' || LAST_NAME)
IF statement example
You want to compare total sales in two sales order transaction tables. You want to analyze USA sales and international sales.
Table A contains the following columns:
Column
Description
SALES_USA
Stores the order amount for a USA sales transaction.
SALES_INTL
Stores the order amount for an international sales transaction.
Table B contains the following columns:
Column
Description
REGION
Stores the region. Valid values are 'USA' or 'INTL.'
SALES
Stores the order amount for the sales transaction.
To compare the total USA sales, you create a SUM test and specify the following expressions for the table columns:
  • Field A:
    SALES_USA
  • Expression B:
    IF(REGION='USA', SALES, 0)
To compare the total international sales, you create a SUM test and specify the following expressions for the table fields:
  • Field A:
    SALES_INTL
  • Expression B:
    IF(REGION='INTL', SALES, 0)