Skip to Content

Duplicate Visual Filters in Analytical List Page

Hi,

So in ALP I'm trying to add two Visual Filters ( Bar Chart ). There are 3 variable of importance here - EXT_ID (dimension type) , IMPACT (measure type) and INCOME_LOSS (measure type). So now, the goal is to plot two charts as follows -

NOTE : IMPACT = RISK and INCOME_LOSS = TOTAL UNPAID REVENUE. They are defined under sap:label in the annotation.xml file.


1. EXT_ID vs IMPACT

2. EXT_ID vs INCOME_LOSS

Now, what's happening is both these charts are getting duplicated and as a result I have 4 charts instead of 2 as follows -

Here are the relevant parts of the code -

1. manifest.json -

"sap.ui.generic.app": {
"_version": "1.3.0",
"pages": {
"AnalyticalListPage|AtRiskCustomers": {
"entitySet": "AtRiskCustomers",
"component": {
"name": "sap.suite.ui.generic.template.AnalyticalListPage",
"list": true,
"settings": {
"multiSelect": true,
"autoHide": true,
"tableType": "ResponsiveTable",
"defaultContentView": "table",
"smartVariantManagement": true,
"qualifier": "default",
"showGoButtonOnFilterBar": true,
"condensedTableLayout": false,
"keyPerformanceIndicators": {}
}
},
"pages": {
"ObjectPage|AtRiskCustomers": {
"entitySet": "AtRiskCustomers",
"component": {
"name": "sap.suite.ui.generic.template.ObjectPage"
}
}
}
}
}

2. metadata.xml

<EntityType Name="AtRiskCustomersType" sap:semantics="aggregate">
<Key>
<PropertyRef Name="IP_FILTER"/>
<PropertyRef Name="CUST_ID"/>
</Key>
<Property Name="IP_FILTER" Type="Edm.String" Nullable="false" sap:parameter="optional" sap:label="IP_FILTER"/>
<Property Name="ANNUAL_LIABILITY" Type="Edm.String" MaxLength="30"  sap:filterable="true" sap:aggregation-role="measure" sap:label="ANNUAL LIABILITY"/>
<Property Name="ACTUAL_DTR" Type="Edm.Int32"  sap:filterable="true" sap:label="ACTUAL_DTR"/>
<Property Name="INFLUENCE" Type="Edm.Int32" sap:aggregation-role="measure"  sap:filterable="true" sap:label="INFLUENCE"/>
<Property Name="IMPACT" Type="Edm.Int32"  sap:aggregation-role="measure"  sap:filterable="true" sap:label=" RISK "/>
<Property Name="DAYS_TO_REACT" Type="Edm.Int32" sap:filterable="true"  sap:label="DAYS_TO_REACT"/>
<Property Name="PREDICTED_REACTION_DATE" Type="Edm.DateTime" sap:display-format="Date" sap:label="PREDICTED_REACTION_DATE"/>
<Property Name="EXT_ID" Type="Edm.String" MaxLength="30" sap:filterable="true" sap:aggregation-role="dimension"  sap:label="CUSTOMER ID"/>
<Property Name="NAME" Type="Edm.String" MaxLength="30" sap:aggregation-role="dimension" sap:filterable="true" sap:label="CUSTOMER NAME"/>
<Property Name="CUST_ID" Type="Edm.Int64" sap:filterable="true" sap:label="Customer ID"/>
<Property Name="CURRENCY_DESC" Type="Edm.String" MaxLength="100" sap:label="DESCRIPTION"/>
<Property Name="CURRENCY" Type="Edm.String" MaxLength="100" sap:filterable="true" sap:label="STR_VALUE"/>
<Property Name="INCOME_LOSS" Type="Edm.Decimal" Precision="30" Scale="2"  sap:filterable="true" sap:aggregation-role="measure" sap:label="TOTAL UNPAID REVENUE"/>
<Property Name="IS_SHOW_DETAILS" Type="Edm.Int32" sap:filterable="true" sap:label="Show Data in Customer Details Flag"/>
</EntityType>

3. Annotation.xml

In this file - I have the following structures for the chart

a. Chart ( Qualifier - FilterImpactByID ) assigned to PresentationVariant (Qualifier - FilterImpactByID )

b. Chart ( Qualifier - FilterInfluenceByID) assigned to PresentationVariant ( Qualifier - FilterInfluenceByID )

c. For the Common.ValueList (EXT_ID) - I have assigned the above two PresentationVariants to 2 separate PresentationVariantQualifiers with Qualifiers xyz and abc .

Below is the code -

Chart1

<Annotation Term="UI.Chart" Qualifier="FilterInfluenceByID">
<Record Type="UI.ChartDefinitionType">
<PropertyValue Property="ChartType" EnumMember="UI.ChartType/Bar"/>
<PropertyValue Property="Measures">
<Collection>
<PropertyPath>INCOME_LOSS</PropertyPath>
</Collection>
</PropertyValue>
<PropertyValue Property="MeasureAttributes">
<Collection>
<Record Type="UI.ChartMeasureAttributeType">
<PropertyValue Property="Role" EnumMember="UI.ChartMeasureRoleType/Axis1"/>
<PropertyValue Property="Measure" PropertyPath="INCOME_LOSS"/>
</Record>
</Collection>
</PropertyValue>
<PropertyValue Property="Dimensions">
<Collection>
<PropertyPath>EXT_ID</PropertyPath>
</Collection>
</PropertyValue>
<PropertyValue Property="DimensionAttributes">
<Collection>
<Record Type="UI.ChartDimensionAttributeType">
<PropertyValue Property="Dimension" PropertyPath="EXT_ID"/>
<PropertyValue Property="Role" EnumMember="UI.ChartDimensionRoleType/Category"/>
</Record>
</Collection>
</PropertyValue>
<PropertyValue Property="Title" String="Customers by Total Unpaid Revenue"/>
</Record>
</Annotation>

Chart 2

<Annotation Term="UI.Chart" Qualifier="FilterImpactByID">
<Record Type="UI.ChartDefinitionType">
<PropertyValue Property="ChartType" EnumMember="UI.ChartType/Bar"/>
<PropertyValue Property="Measures">
<Collection>
<PropertyPath>IMPACT</PropertyPath>
</Collection>
</PropertyValue>
<PropertyValue Property="MeasureAttributes">
<Collection>
<Record Type="UI.ChartMeasureAttributeType">
<PropertyValue Property="Role" EnumMember="UI.ChartMeasureRoleType/Axis1"/>
<PropertyValue Property="Measure" PropertyPath="IMPACT"/>
</Record>
</Collection>
</PropertyValue>
<PropertyValue Property="Dimensions">
<Collection>
<PropertyPath>EXT_ID</PropertyPath>
</Collection>
</PropertyValue>
<PropertyValue Property="DimensionAttributes">
<Collection>
<Record Type="UI.ChartDimensionAttributeType">
<PropertyValue Property="Dimension" PropertyPath="EXT_ID"/>
<PropertyValue Property="Role" EnumMember="UI.ChartDimensionRoleType/Category"/>
</Record>
</Collection>
</PropertyValue>
</Record>
</Annotation>

Presentation Variant 1 -

<Annotation Term="UI.PresentationVariant" Qualifier="FilterInfluenceByID">
<Record Type="UI.PresentationVariantType">
<PropertyValue Property="Text" String="INFLUENCE by CUSTOMER ID"/>
<PropertyValue Property="Visualizations">
<Collection>
<AnnotationPath>@UI.Chart#FilterInfluenceByID</AnnotationPath>
</Collection>
</PropertyValue>
</Record>
</Annotation>

Presentation Variant 2 -

<Annotation Term="UI.PresentationVariant" Qualifier="FilterImpactByID">
<Record Type="UI.PresentationVariantType">
<PropertyValue Property="Text" String="Impact VS EXT_ID"/>
<PropertyValue Property="Visualizations">
<Collection>
<AnnotationPath>@UI.Chart#FilterImpactByID</AnnotationPath>
</Collection>
</PropertyValue>
</Record>
</Annotation>

Finally the EXT_ID property -

<Annotations Target="com.odata.v2.sap.cr.AtRiskCustomersType/EXT_ID">
<Annotation Term="Common.ValueList" Qualifier="abc">
<Record Type="Common.ValueListType">
<PropertyValue Property="CollectionPath" String="AtRiskCustomers"/>
<PropertyValue Property="PresentationVariantQualifier" String="FilterInfluenceByID"/>
<PropertyValue Property="SearchSupported" Bool="false"/>
</Record>
</Annotation>
<Annotation Term="Common.ValueList" Qualifier="xyz">
<Record Type="Common.ValueListType">
<PropertyValue Property="CollectionPath" String="AtRiskCustomers"/>
<PropertyValue Property="PresentationVariantQualifier" String="FilterImpactByID"/>
<PropertyValue Property="SearchSupported" Bool="false"/>
</Record>
</Annotation>
</Annotations>

Regards,

Dev

chart2.png (9.0 kB)
chart3.png (87.4 kB)
chart1.png (8.9 kB)
Add a comment
10|10000 characters needed characters exceeded

Related questions

1 Answer

  • Best Answer
    Posted on Feb 07, 2019 at 11:36 AM

    Hi Boudhayan,

    You can simply open the visual filter dialog from Adapt Filters and change the measure for the visual filter. Please see if that would suffice.

    Regards,
    Antariksha.

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.