SAP Knowledge Base Article - Public

3525614 - Sorting order of characteristic values in a BW query is not the same in different frontend tools like AO and Bex Analyzer

Symptom

In BW query definition, the defined sorting of a characteristic is set as "As in Query".


When executing the query in different frontend tools, different sorting orders for the characteristic are observed. For example, in AO, the characteristic is by default sorted by characteristic text, while in Bex Analyzer, the the characteristic is by default sorted by characteristic key.

"Image/data in this KBA is from SAP internal systems, sample data, or demo systems. Any resemblance to real data is purely coincidental".  

Environment

  • SAP Analysis for Microsoft Office
  • BW BEx Analyzer

Reproducing the Issue

  1. In BW modeling tool or Query designer, in a query's definition, for a characteristic A, Value Output Format property is set as Display As = 'Text', and Sorting property is set as Sort By= 'As in Query'.
  2. Run the query in Analysis Office.
  3. Dimension A is sorted by text.
  4. Run the same query in Bex Analyzer.
  5. Dimension A is sorted by key.

Cause

The default sorting which is chosen by selection "As in the query"/"As in Query" in query designer/BW Modeling Tool. Fontend client tools tries to sort in the following order and pick the first sorting type available:

  1. Sort by selection space (fixed filter values added in 'Filter: Fixed values').
  2. Sort by selection state (dynamic filter values added in 'Filter: Default values').
  3. According to diffrent frontend client tools, there are two kinds of behavior:
    • For all clients using the BICS or ABAP BICS API like BEx Java Web, Analysis for Office, Webi, Lumira designer, RSRT ABAP BICS mode etc.:
      sort according to the definition of the Value Output Fomat. If e.g. Display As = 'Text and Key', the values are sorted regarding the text. In case Display As = 'Key and Text', the values are sorted regarding the key values.
      One exception: For date/time based characteristics, it is also sorted by key as sorted by text would not make sense here.
    • For RSRT HTML mode and BEx Analyzer, it is always sorted by characteristic key.

      Therefore when the characteristic Value Output Format is set as Display As = 'Text and Key' or Display As = 'Text', in AO values are sorted by text. While in Bex Analyzer values are sorted by key.

Resolution

In Bex Analyzer, if the characteristic values are expected be sorted by text, change characteristic "Sort By" from "As in Query" to "Text" in query designer/BW Modeling Tool or during Bex Analyzer runtime.
Vice versa in Analysis for Office if the characteristic values are expected be sorted by key, change characteristic "Sort By" from "As in Query" to "Key" in query designer/BW Modeling Tool or during Analysis for Office runtime.

See Also

2128583 - Sorting of BW Query Results

Keywords

sort, hard filter, static filter, characteristic restriction, default values, Analysis Office, Analysis for Office, A4O, Analysis for Excel, A4O, BI Java, BEx Java, BI Tools, Bex Tools , KBA , BW-BEX-ET-WB-7X , 7.x Analyzer Frontend , BW-BEX-OT-OLAP , Analyzing Data , BI-RA-AO-XLA , Excel Addin , BW-BEX-ET-QDEF , Queries (Definition and Modification) , BW-MT-ELEM , Query Designer in BW Modeling Tools (Eclipse) , How To

Product

SAP Analysis for Microsoft Office all versions