Properties of a Filter
Define the properties of a filter to determine the capability of the filter.
Required Editions
Available in: Lightning Experience Available in: Enterprise and Unlimited Editions where Consumer Goods Cloud is enabled |
| Name | Description | Example |
|---|---|---|
| accountsfids | Standard account filter | |
| productsfids | Standard product filter | |
| productlevel | Standard product level filter. This filter derives the attributes shown or exported to an Excel sheet. If you use a product level productlevel"singleselect",filter on a report, then configure the report "name":for the most detailed level by maintaining "productlevel",all aggregation levels and using all productlevels in the report layout. | |
| kpigroup | Standard KPI group filter | |
| subaccountsfids | Standard subaccount filter | |
| promo_templatesfid | Standard promotion template filter. You can use this filter only for AccountMonthlyMeasures and promo_templatesfid"multiselect",AccountWeeklyMeasures datasources. This "label": "Promotionfilter also calls an apex remote action and therefore can be customized. | |
| promo_phase | Standard promotion phase filter. You can use this filter only for AccountMonthlyMeasures andpromo_phase"label": "Promotion Phase",AccountWeeklyMeasures data sources. This "name": "promo_phase",filter also calls an apex remote action and therefore can be customized. | |
| periodyear | Standard period year filter. You can’t use this filter with weekly data sources. | |
| periodmonth | Standard period month filter | |
| periodweek | Standard period week filter | |
| promo_timeframe | By default, promotions are considered in real-time reports if their start date falls within the selected reporting time range. promo_timeframe"name": "promo_timeframe",However, promotions starting before the "label": "Promotion Time selected time frame or extending beyond Frame",it aren’t considered. Use this filter to allow "values": [the user to select Overlapping or Including as the product time frame. With Overlapping selected, promotions that start before the selected time frame are {“label”: “Default”“value”: “default”},{considered. For example, a promotion that “label”:begins on December 27, 2022, and “Overlapping”continues into mid-January 2023 is also “value”:included. With the Including option, promotions that start before the selected time frame and{“label”: “Including”extend beyond it are also included. For instance, a promotion that commences on “value”: “including”December 27, 2022 , and continues until mid-January 2024 is also included. |
|
To filter data based on attributes of promotion, use any attribute from the promotion dimension as a filter. To use an attribute from promotion dimension, maintain the attribute in promotion dimension with its attribute name and label. Here’s an example of promotion dimension.
[
{
"sortenum": [
"initial",
"Planning",
"Commited",
"Canceled"
],
"fielddb$label": "phase",
"fieldsf$label": "ACCL__Phase__c",
"fielddb": "phase",
"fieldsf": "ACCL__Phase__c",
"name": "phase"
},
{
"fielddb$label": "Slogan",
"fieldsf$label": "ACCL__Slogan__c",
"fielddb": "phase",
"fieldsf": "ACCL__Slogan__c",
"name": "slogan"
},
{
"fieldsf$label": "ACCL__Promotion_Template__r.ACCL__Description__c",
"fieldsf": "ACCL__Promotion_Template__r.Id",
"name": "type"
},
{
"fieldsf$label": "ACCL__Promotion_Template__r.ACCL__Product_Definition_Level__c",
"fieldsf": "ACCL__Promotion_Template__r.ACCL__Product_Definition_Level__c",
"name": "productdeflevel"
},
{
"fieldsf$label": "ACCL__Date_From__c",
"fieldsf": "ACCL__Date_From__c",
"name": "datefrom"
},
{"fieldsf$label": "ACCL__Date_Thru__c",
"fieldsf": "ACCL__Date_Thru__c",
"name": "datethru"
},
{
"fieldsf$label": "ACCL__Delivery_Date_From__c",
"fieldsf": "ACCL__Delivery_Date_From__c",
"name": "instoredatefrom"
},
{
"fieldsf$label": "ACCL__Delivery_Date_Thru__c",
"fieldsf": "ACCL__Delivery_Date_Thru__c",
"name": "instoredatethru"
},
{
"fieldsf": "ACCL__Count_Tactics__c",
"fieldsf$label": "ACCL__Count_Tactics__c",
"name": "tacticcount"
},
{
"fieldsf": "ACCL__Is_Frozen__c",
"fieldsf$label": "ACCL__Is_Frozen__c",
"name": "isFrozen"
},
{
"fieldsf": "Id",
"fieldsf$label": "Name",
"name": "id"
}
]Here’s an example of a filter configuration to add a product definition level filter where products are maintained at promotion or tactic level.
{
"type": "singleselect",
"name": "promo_s_productdeflevel",
"label": "ProductDefinitionLevel",
"values": [
{
"label": "Promotion",
"value": "Promotion"
},
{
"label": "Tactic",
"value": "Tactic"
}
]
}To add custom filters to a report that uses promotion dimension, create a filter by using the syntax:<prefix>_<valuetype>_<promodimensionmetaattributename>. Always use promo as the prefix. For promotion dimension attribute name, use the name of the promotion dimension. For value type, enter the type of the value, such as string.
| Type | Value Type | promotiondimensionmeta attribute name | Filter Name |
|---|---|---|---|
| singleselect | String | productdeflevel | promo_s_productdeflevel |
| singleselect | Number | threshold | promo_n_threshold |
| singleselect | Boolean | frozen | promo_b_frozen |
| multiselect | Any type | productdeflevel | promo_a_productdeflevel |
FilterType
Here are the types of filters.
- singleselect: Use to restrict selection to only one value. Always provide a source with a set of values.
- multiselect: Use to allow selecting multiple values from a list. Always provide a source with a set of values.
- periodmonth: Use to specify the time frame in months as a filter.
- periodweek: Use to specify the time frame in weeks as a filter.
- hidden: To hide a filter in the UI. The value of this filter is always the defined default value.
- fixed: Use to add a filter that is visible on the UI but can’t be edited. The value of the filter is always the defined default value.
- subaccount: Use to show subaccounts based on the selected accounts.
FilterDefaultValue
The default value of a filter depends on the type of filter.
| Type | Default Value | Format |
|---|---|---|
| subaccount, multiselect, hidden, and fixed | <<ALL_ VALUES>>: All available values are selected | |
| <<FIRST_ VALUE>>: Only the first value is selected | |
|
| <<MIDDLE_ VALUE>>: Only the middle value is selected | |
|
| <<LAST_ VALUE>>: Only the last value is selected | |
|
| Array of values: The value of the array is selected | — | |
| singleselect | <<FIRST_ VALUE>>: Only the first value is selected | |
| periodmonth or periodweek | Define the default value of period filters by using a JSON with these attributes:
|
or |
FilterValues
Values for the selected filter types. The values include these attributes:
- label: The name of the filter value that’s shown.
- value: The possible values for the filter.
- accountsfld: Details of the main account of the subaccount that’s added as the filter. This field is mandatory only when the filter type is subaccount.
ValuesProvider
Represents the metadata required to request the filter values from an Apex class for select and multiselect filters. The metadata includes these attributes.
- class: The APEX class that calls filter values.
- method: The method that is passed to the Apex callable class on the action parameter. The default value is an empty string.
- params: The JSON object that is passed as parameters to the Apex callable class. The default value is an empty object.
- cacheable: Indicates whether the data of an APEX call must be cached. Use this setting to achieve better performance when you’re using data that doesn’t change often. The default value is false.
- labelField: Determines the returned objects to be used as a label for filter values. The default value is label.
- valueField: Determines the returned objects to be used as the value for the filter values. The default value is value.
ValuesSource
Describes the built-in possible sources for filter values. For example, if the source is categories, then the available product categories are shown in the filter. To use a custom APEX class, set the source attribute to the name of the APEX class that you want to use:
{"
name": "accountids",
"type": "multiselect",
"required": true,
"label": "Customers",
"source": "myCustomAPEXClass",
}Use sources of filters together with the filter names that they’re linked to. For example, if the source is defined as subaccounts, use only the filters that are linked to the subaccounts. The possible value sources are:
- PlanAccounts: Generates values with all the accounts that you have access to.
- SubAccounts: Generates the subaccounts filter values for a subaccount filter based on
- Categories: Generates values with all the product categories that you have access to.
- Products: Generates values with all the products of the specified level that you have access to.
- KPIs: Generates values with all the KPIs that are included in a report.
- KPIGroup: Generates values with all the KPI groups that are included in a report.
- ProductDimension: Generates values with all the product dimensions that are included in
- TimeDimension: Generates values with all the time dimensions that are included in a report.
- PeriodYear: Generates five values until the current year.
accountfilter
Here’s an example for an account filter:
{"
type": "singleselect",
"name": "accountsfids",
"label": "Accounts",
"source": "PlanAccounts"
}
