Skip to Content

visual filters are not displaying through fiori elements

Hi

am using below to develop analytic list page , everything looks good except visual filter

reference blogs

https://blogs.sap.com/2018/04/04/create-an-analytical-list-page-using-abap-cds-views-and-annotations/

@AbapCatalog.sqlViewName : 'ZQUERYFLIGHTALP'
@AbapCatalog.compiler.compareFilter: true
@AccessControl.authorizationCheck: #CHECK
@EndUserText.label: 'Flight (Analytical List Page)'


@Analytics.query: true
@VDM.viewType: #CONSUMPTION
@OData.publish: true


@UI.selectionPresentationVariant: [{
    qualifier: 'KPIWeightByCountry',
    presentationVariantQualifier: 'KPIWeightByCountry',
    selectionVariantQualifier: 'KPIWeightByCountry'
},{
    qualifier: 'Default',
    presentationVariantQualifier: 'Default',
    selectionVariantQualifier: 'Default'
}]


@UI.presentationVariant: [{
    qualifier: 'KPIWeightByCountry',
    text: 'KPI: Weight of Luggage per Country',
    visualizations: [{
        type: #AS_CHART,
        qualifier: 'ChartWeightByCountry'
    },{
        type: #AS_DATAPOINT,
        qualifier: 'WeightOfLuggage'
    }]
},
//{
//    qualifier: 'FilterBookingsByAirline',
//    text: 'Filter: Bookings by Airline',
//    visualizations: [{
//        type: #AS_CHART,
//        qualifier: 'ChartBookingsByAirline'
//    }]
//    },
{
    qualifier: 'FilterBookingsByYear',
    text: 'Filter: Bookings by Year',
    visualizations: [{
        type: #AS_CHART,
        qualifier: 'ChartBookingsByYear'
    }]
},




{
    qualifier: 'Default',
    visualizations: [{
        type: #AS_CHART,
        qualifier: 'ChartDefault'
    }]
}]


@UI.selectionVariant: [{
    qualifier: 'KPIWeightByCountry',
    text: 'Default'
},{
    qualifier: 'Default',
    text: 'Default'
}]


@UI.chart: [{
    qualifier: 'ChartWeightByCountry',
    chartType: #COLUMN,
    dimensions:  [ 'CustomerCountry' ], 
    measures:  [ 'WeightOfLuggage' ],
    dimensionAttributes: [{
        dimension: 'CustomerCountry',
        role: #CATEGORY
    }],
    measureAttributes: [{
        measure: 'WeightOfLuggage',
        role: #AXIS_1
    }]
},
//{
//    qualifier: 'ChartBookingsByAirline',
//    chartType: #DONUT,
//    dimensions:  [ 'Airline' ], 
//    measures:  [ 'TotalOfBookings' ],
//    dimensionAttributes: [{
//        dimension: 'Airline',
//        role: #CATEGORY
//    }],
//    measureAttributes: [{
//        measure: 'TotalOfBookings',
//        role: #AXIS_1
//    }]
//},


{
    qualifier: 'ChartBookingsByYear',
    chartType: #DONUT,
    dimensions:  [ 'CalendarYear' ], 
    measures:  [ 'TotalOfBookings' ],
    dimensionAttributes: [{
        dimension: 'CalendarYear',
        role: #CATEGORY
    }],
    measureAttributes: [{
        measure: 'TotalOfBookings',
        role: #AXIS_1
    }]
}, 


{
    qualifier: 'ChartDefault',
    chartType: #COLUMN,
    dimensions:  [ 'CalendarYear', 'Airline' ], 
    measures:  [ 'TotalOfBookings' ],
    dimensionAttributes: [{
        dimension: 'CalendarYear',
        role: #SERIES
    },{
        dimension: 'Airline',
        role: #CATEGORY
    }],
    measureAttributes: [{
        measure: 'TotalOfBookings',
        role: #AXIS_1
    }]
}
]


define view Z_Query_Flight_ALP 
  as select from Z_Cube_FlightBookings
{
    @AnalyticsDetails.query.display: #KEY_TEXT
//        @UI.selectionField.position: 10
    
    @UI.lineItem.position: 10
    Airline,
    
    @AnalyticsDetails.query.display: #KEY_TEXT
    CustomerCountry,
    
    @UI.selectionField.position: 10
    CalendarYear,
    
    @UI.lineItem.position: 20
    TotalOfBookings,
    
    @UI.dataPoint.title: 'Weight of Luggage'
    @UI.lineItem.position: 30
    WeightOfLuggage
}


capture.png (10.7 kB)
Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

1 Answer

  • Feb 14 at 11:36 AM

    Hi Hussain,

    Kindly go through the help documentation we have maintained for the visual filter setup :

    https://help.sap.com/viewer/DRAFT/96880755e4e64fcd96c12694f430fece/Internal/en-US/1714720cae984ad8b9d9111937e7cd38.html

    https://help.sap.com/viewer/DRAFT/96880755e4e64fcd96c12694f430fece/Internal/en-US/16d43eb0472c4d5a9439ca1bf92c915d.html

    1. Make sure the filter you want to represent as Visual filter is already added to your SelectionFields.

    2. Then define value list annotation (with a qualifier for Visual filter) for that filter. It should have a property called PresentationVariantQualifier where you give the qualifier of the PV you want to use

    3. Define a PV with this qualifier and under visualizations, refer to your chart annotation.

    4. Also, define this chart annotation.

    The PV and chart annotations should be defined under the entity set that you mention in the "CollectionPath" property in you ValueList annotation.

    Please go through these steps and documents and if you are still not able to bring the visual filters up, feel free to get back with your project.

    Regards,

    Reshma

    Add comment
    10|10000 characters needed characters exceeded