WITHATTR

Specifies the characteristics of a base-dimension member that match the specified values in a report script. You must create attribute dimensions in the outline and associate them with a base dimension before you use WITHATTR.

Syntax

<WITHATTR (dimName, "operator", value)

Parameters

dimName

Single attribute dimension name.

"operator"

Operator specification, which must be enclosed in double quotes ("").

The supported operators are:

  • > (Greater than)

  • >= (Greater than or equal to)

  • < (Less than)

  • <= (Less than or equal to)

  • = = (Equal to)

  • <> or != (Not equal to)

  • IN (Within a specified range)

Note:

These operators may behave differently depending on the attribute type with which you use them. See the table in Examples for more information.

value

Value that, in combination with the operator, defines the condition that must be met. Can be an attribute member specification, a constant, or a date-format function (for example, <TODATE).

Notes

This command specifies two or more attribute dimension tags, which are associated with a base dimension. If you use the <WITHATTR syntax, the command is applied only to a specific query.

Example

Example 1

The following table shows examples, based on the Sample Basic database, for each type of operator:

Table 4-5 <WITHATTR Operator Examples

Operator Example Result
> <WITHATTR(Population,">","18000000") Returns New York, California, and Texas
>= <WITHATTR(Population,">=",10000000) where 10,000,000 is not a numeric attribute member, but a constant Returns New York, Florida, California, Texas, Illinois, and Ohio
< <WITHATTR(Ounces,"<","16") Returns Cola, Diet Cola, Old Fashioned, Sasparilla, and Diet Cream
<= <WITHATTR("Intro Date","<=",<TODATE("mm-dd-yyyy","04-01-1996")) Returns Cola, Diet Cola, Caffeine Free Cola, and Old Fashioned
= = <WITHATTR("Pkg Type","= =",Can) Returns Cola, Diet Cola, and Diet Cream
<> or != <WITHATTR(Caffeinated,"<>",True) Returns Caffeine Free Cola, Sasparilla, Birch Beer, Grape, Orange, Strawberry
IN <WITHATTR("Population","IN",Medium) Returns Massachusetts, Florida, Illinois, and Ohio

Example 2

The following report script

<PAGE (Product, Measures, Scenario)
Florida Sales Actual

 <COLUMN (Year)
 <ICHILDREN Year

<ROW  (Market)
<WITHATTR(Population IN Large)
 !

returns on rows only those members of Market whose Population attributes map to ranges defined as Large:

                             Product Sales Actual 

                     Qtr1     Qtr2     Qtr3     Qtr4     Year 
                 ======== ======== ======== ======== ======== 

New York            7,705    9,085    9,325    8,583   34,698 
California         11,056   12,164   13,073   11,149   47,442 
Texas               4,505    4,589    4,807    4,402   18,303