Table of Contents

Search

  1. Preface
  2. Introduction to Data Validation Option
  3. Repositories
  4. XML Data Source
  5. Tests for XML Data Sources
  6. Connections
  7. Expressions
  8. Table Pairs
  9. Tests for Table Pairs
  10. Single-Table Constraints
  11. Tests for Single-Table Constraints
  12. Examples of Tests from Spreadsheets
  13. SQL Views
  14. Lookup Views
  15. Join Views
  16. Aggregate Views
  17. Business Intelligence and Reporting Tools Reports
  18. Dashboards
  19. DVOCmd Command Line Program
  20. Troubleshooting
  21. Appendix A: Datatype Reference
  22. Appendix B: Reporting Views
  23. Appendix C: Metadata Import Syntax
  24. Appendix D: Jasper Reports
  25. Appendix E: 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)
IIF 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:
    IIF(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:
    IIF(REGION='INTL', SALES, 0)

0 COMMENTS

We’d like to hear from you!