INFOMAPS Procedure

INSERT FILTER Statement

Inserts a filter into the current information map. A filter provides criteria for subsetting a result set.
Note: For relational databases, a filter is a WHERE clause.

Syntax

INSERT FILTER CONDITION="conditional-expression" <options>;

Summary of Optional Arguments

specifies additional properties for the filter.
specifies the description of the filter to be inserted.
specifies the folder in the information map into which to insert the filter.
specifies whether to hide the filter from users of the information map.
specifies the ID of the filter to insert.
specifies the name of a filter to insert into the current information map.

Required Argument

CONDITION="conditional-expression"
The following rules apply to the conditional-expression value:
For relational data
Any reference to physical or business data in a relational table must be enclosed in double angle brackets (<< >>). Everything between double angle brackets is maintained just as it is. That is, case and blanks are maintained.
If you are referring to a physical column, then you must qualify the column with the data source ID. For example, <<Transaction.Sales_Tax>>. If you are referring, in an expression, to a data item in the current information map, then you do not need to qualify the data item ID. You can refer explicitly to the current information map by specifying root as the qualifier. For example, <<root.MODEL_ID>>.
For OLAP data
Expressions for OLAP data items must resolve to a valid, one-dimensional MDX set. Use double angle brackets (<< >>) to enclose references to an OLAP measure, OLAP dimension, OLAP hierarchy, or an OLAP level. Use single sets of square brackets ([ ]) to enclose a reference to an OLAP member.

Optional Arguments

CUSTOM_PROPERTIES=(custom-properties-list)
specifies additional properties for the filter. Custom properties are supported by specific SAS applications such as SAS Marketing Automation. The form of the custom-properties-list value is
("property-name-1" "property-value-1" <"description-1">)
...
("property-name-n" "property-value-n" <"description-n">)
where
property-name
specifies the name of the property.
Restriction:Property names cannot begin with an underscore (_) character.
Requirement:Property names must be unique. If a specified property name already exists in the filter, then the INSERT FILTER statement will fail. Therefore, it is recommended that you add a prefix or suffix to the property name to ensure uniqueness.
property-value
specifies the value of the property.
description
specifies the description of the property. The description is optional.
DESCRIPTION="descriptive-text"
specifies the description of the filter to be inserted.
Alias:DESC=
FOLDER="folder-name" </CREATE>
FOLDER="folder-location" </CREATE>
specifies the folder in the information map into which to insert the filter. The following rules apply:
  • If the folder is in the root directory of the information map, then you can specify the folder by name, without an initial slash. For example, folder="CUSTOMERS".
  • If the folder is not in the root directory, then you must specify the location of the folder beginning with a slash. For example, folder="/CUSTOMERS/Europe".
/CREATE
specifies that the named folder or location is created automatically if it does not already exist.
Alias:LOCATION=
Restrictions:The following characters are not valid in a folder name:
  • / \
  • null characters
  • non-blank nonprintable characters

A folder name can contain blank spaces, but it cannot consist only of blank spaces.

HIDDEN=YES | NO
specifies whether to hide the filter from users of the information map. By default, the filter is available to users of the information map. Specify HIDDEN=YES if you want to hide the filter from users (for example, when the filter is used as an assigned filter for a data source and therefore should not be applied again).
Default:NO
ID="filter-ID"
specifies the ID of the filter to insert. If you do not specify an ID, the INFOMAPS procedure generates a unique ID from the filter name. You can use the LIST statement to display filter IDs.
Restrictions:Nulls and non-blank nonprintable characters are not valid in an ID. The following characters are invalid:
. < > [ ] { } \ / ^ @ ~
If a name contains any of these characters, they are replaced with an underscore (_) when the ID is generated from the name.

The first 32 characters of an ID must be unique across the information map. An error occurs if you specify an ID that is the same as an existing ID (data item, data source, filter, or other). An ID that differs only by case from another ID in the current information map is not considered unique.

NAME="filter-name"
specifies the name of a filter to insert into the current information map. If the NAME= option is missing from the INSERT FILTER statement, the INFOMAPS procedure will generate a default name.
Restriction:Nulls and non-blank nonprintable characters are not valid characters for a filter name.

Examples

Example 1

/* Insert a relational table filter. */ 
insert filter 
   name="genderFilter"
   id="Boys"
   description="Filter for boys"
   folder="/Filters" /create
   condition='<<CLASS.sex>> = "M"';

Example 2

/* Insert an MDX filter. */
insert filter
   name="dates1"
   condition="<<Dates_FirstChild>> <>
   [cust_dates].[All cust_dates].[1996].[1996/06].[24JUN96]";

Example 3

/* Insert an MDX filter. */
insert filter
   name="dates2"
   condition="<<Dates_Dates>>=[cust_dates].[All cust_dates].[1998].[1998/02],
   [cust_dates].[All cust_dates].[1998].[1998/02].[03FEB98]";