LookupPeriodName

Summary

The LookupPeriodName function returns the xactly.xc_period.name for the specified date and period type name string. Use the function as an alternative to joining to the xactly.xc_period and xactly.xc_period_type tables in xSQLSELECT statements.

Syntax

LookupPeriodName(<date>, <string>)

Return Type

String.

Return value will be null if an invalid period type name or date was given.

Details

The period type name string should match a valid value in the xactly.xc_period_type.name table. The default values are ‘MONTHLY’, ‘QUARTERLY’, and ‘YEARLY’ and are case insensitive.

Examples

eval LookupPeriodName(‘2016-04-01’, ‘MONTHLY’);

Screen Shot 2016-09-07 at 9.33.34 AM

eval LookupPeriodName(‘2016-04-01’, ‘quarterly’);

Screen Shot 2016-09-07 at 9.33.41 AM

set v_period_name = LookupPeriodName(‘2015-06-03′,’MONTHLY’);

Screen Shot 2016-09-07 at 9.33.47 AM

select incentive_date,
‘order_batch-‘ || LookupPeriodName(incentive_date, ‘monthly’) as batch_name
from staging.order_item limit 10;

Screen Shot 2016-09-07 at 9.33.56 AM

Related Functions

LookupPeriodIdByBatchName

LookupPeriodIdByName

LookupPeriodNameById