Skip to main content
Skip table of contents

SEGMENTDESCRIPTION

Overview

The SEGMENTDESCRIPTION function returns the description(s) of a segmented key(s) as defined within the ERP.

Syntax

CODE
=SEGMENTDESCRIPTION(ConnectionName, SegmentedKeyName, SegmentId, LookupValue, [KeepRawIfNotFound], [ValueMode])

Arguments

The SEGMENTDESCRIPTION function uses the following arguments:

Argument

Required/Optional

Description

ConnectionName

Required

The name of the connection as configured in the Connection Manager.

SegmentedKeyId

Required

The segmented key name for which to filter segments.

SegmentId

Required

The segment number for which to filter segments.

LookupValue

Required

The segment value (or an array of segment values) specifying for which segments we want to display descriptions.

KeepRawIfNotFound

Optional

TRUE (default)
or
FALSE

If a description for the LookupValue is not found in the ERP, this argument determines whether the function returns the LookupValue itself or returns a #VALUE! that can be trapped using Excel's IFERROR() function.

ValueMode

Optional

0 (default) - interprets the value specified in the LookupValue argument as the full segmented key value (e.g., full subaccount).
or
1 -interprets the value specified in the LookupValue argument as the individual segment for the segment specified in the SegmentID arguments (e.g., the 2nd segment of the subaccount).

When using the 1 option, if the value specified in the LookupValue argument is longer than the length of the SegmentID (as defined within the ERP), the function will return #VALUE!

Example

Given the following configuration within the ERP:


Example 1 - Description of segment 1 from full subaccount

CODE
=SEGMENTDESCRIPTION("Demo", "Subaccount", 1, B4#)


Description
Returns an Excel array containing the descriptions of the first segment 1 values for the subaccounts returned by the function in cell B4

Result

Example 2 - Description of segment 2 from full subaccount

CODE
=SEGMENTDESCRIPTION("Demo", "SUBACCOUNT, 2, B4#)


Description
Returns an Excel array containing the descriptions of the second segment values for the entire SUBACCOUNT returned by the function in cell B4 (and returning the subaccount segment value if the description is not found in the ERP)

Result

Example 3 - Description of segment 2 from only the segment value

CODE
=SEGMENTDESCRIPTION("Demo", "SUBACCOUNT, 2, D4#, , 1)


Description
Returns an Excel array containing the descriptions of the second segment values returned by the function in cell D4:

Result

JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.