Wednesday, 29 September 2021

Cascading Filter Prompts in SAP HANA Modelling

Cascading filters are a group of prompts where the selection of one filter regulates the list of values accessible for selection in the successive filters. The key intention for this cascading is to make sure a better user experience by providing users with valid combinations of input parameter values. This feature is liked by many customers as it allows them to have a preview of their data through prompts before essentially seeing the information.

For Instance: We have two filter prompts for our HANA calculation view Country and State filter, So if we select India as country in our first prompt so we’ll automatically get only states of India in list of values like below:

SAP HANA Modelling, SAP HANA Career, SAP HANA Learning, SAP HANA Guides, SAP HANA Preparation, SAP HANA Prep

In this blog post, let’s look how cascading filters can be accomplished in SAP HANA views through mapping of Input Parameters. Here we’ll try to get corresponding week ending dates for a selected Year Month value.

For achieving cascading effect in calculation view say “ZTEST_CASCADE” we need one more view say “ZVALHELP”. Let’s first create value help view with 2 input parameters (P_YearMonth, P_WeekEnding) and allocate them as filters in projection node’s expression.

SAP HANA Modelling, SAP HANA Career, SAP HANA Learning, SAP HANA Guides, SAP HANA Preparation, SAP HANA Prep

SAP HANA Modelling, SAP HANA Career, SAP HANA Learning, SAP HANA Guides, SAP HANA Preparation, SAP HANA Prep

Later in our main calculation view “ZTEST_CASCADE” create 2 IPs and map End Date parameter with value help view as below

SAP HANA Modelling, SAP HANA Career, SAP HANA Learning, SAP HANA Guides, SAP HANA Preparation, SAP HANA Prep

SAP HANA Modelling, SAP HANA Career, SAP HANA Learning, SAP HANA Guides, SAP HANA Preparation, SAP HANA Prep

Once proper mapping is done apply filter expression and activate to test it. You will able to see only valid Week Ending dates corresponding to selected year month.

SAP HANA Modelling, SAP HANA Career, SAP HANA Learning, SAP HANA Guides, SAP HANA Preparation, SAP HANA Prep

No comments:

Post a Comment