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)
Parameter | Description | ||
---|---|---|---|
dimName | Single attribute dimension name. | ||
"operator" | Operator specification, which must be enclosed in double quotes (""). The supported operators are:
| ||
value | Value that, in combination with the operator, defines the condition that must be met. The value 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
The following table shows examples, based on the Sample Basic database, for each type of operator:
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 |
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
See Also