cancel
Showing results for 
Search instead for 
Did you mean: 

Fetching drill filter values for reports having prompt using webi-restful sdk?

Former Member
0 Kudos

Hi,

following the document for SAP restful services i am able to fetch the drill filters on the report but the when i try to get the values in the filter by getting into the details of a filter i am only getting the ID not the values.

When i using the reports without any prompts i am able to get the filter values within the filter only. the code i am using to get the filter is below.

  //get

  String url = baseURL + "/raylight/v1/documents/"+ documentId+"/reports/"+reportId+"/filters";

  HttpGet post = new HttpGet(url);

  post.setHeader("Content-Type", "application/xml");

  post.setHeader("Accept", "application/xml");

  post.setHeader("X-SAP-LogonToken", logonToken);

  HttpResponse response = client.execute(post);

  Header headers[] = response.getAllHeaders();

  for (int i = 0; i < headers.length; i++) {

  Header header = headers[i];

  System.out.println(header.getName() + "=" + header.getValue());

  }

  BufferedReader rd = new BufferedReader(new InputStreamReader(response

  .getEntity().getContent()));

  String line = "";

  while ((line = rd.readLine()) != null) {

  writer.println(line);

  //System.out.println(line);

  }

  writer.close();

  }

I am unable to understand the behavior to get the filters with and without prompts. please give some suggestion on it.

Thanks and Regrds

Gaurav

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Daniel,

Thanks Daniel.

It works with the new report on the BO 4.1 but  filter values are not displayed if it is the merged dimension.

Also the Reports migrated from the BO 3.6 having the hidden and merged dimension that too is not displaying any value of the filters.

do this drill filter doesn't support the field having merged dimension and hidden fields in the Universe?

Please  to let me know.

Thanks and Regards

Gaurav Monga

daniel_paulsen
Active Contributor
0 Kudos

Hi Gaurav,

It seems you are right, you cannot retrieve the values of the merged dimension used as a drill filter. This does not appear to be correct (expected) behavior.  There is a workaround though.

For the Hidden dimension problem, I am not having this issue, but I am using a UNX file.  I expect that you are using a UNV?  I did not test migrating a UNV, but try and see if a UNX gives the same problem


The workaround for merged dim values:

The merged dimension Id is prefixed with an "L" showing it is a Document link.  That's one way you could determine which filters are merged dimensions or you could also simply check if a dataprovider (ie DP0) isn't part of the ID.

Document Links can be retrieved using:

    .../raylight/v1/documents/<docId>/links/

and details about the link can be retrieved using the link ID ( eg: a merged dimension ID of "L1" would look as follows)

             .../raylight/v1/documents/<docId>/links/L1

This doesn't retrieve values though.  I just thought I'd mention it in case you found it useful to validate a merged dim.

You can actually get the list of values for the merged dimension using the following:

         .../raylight/v1/documents/<docId>/dataobjects/L1/lov

its a bit of a side-step from getting the values directly from the drill filter, but it does offer a workaround to get you moving forward.

Dan

former_member197386
Active Contributor
0 Kudos

Hello,

The issue has been identified and the fix will be delivered quickly in next pach.

Thanks for your help,

Anthony

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi Anthony,

i am using

[GET] <url>/documents/{documentId}/report/{reportId}/driller/filters


but  i am getting only the Filters ids  on the reports  having prompts but not the values.


Please suggest on this how values will be retrieved.

Thanks and Regards

Gaurav

daniel_paulsen
Active Contributor
0 Kudos

If you look at that specific report in BI Launchpad and have the Filter Bar enabled, does it populate the dropdown with a specific value or does it say "All Values"  (ie no single value has been saved)?  If "All Values" then I would expect the request to return the Filter ID only.  If you already have a value selected, then you should see a response similar to the below (I saved the report with "Florida" in the drill filter):

Method:          GET

URL:               http://localhost:6405/biprws/raylight/v1/documents/6781/reports/4/driller/filters

ContentType:  application/xml

Response:

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>

<filters>

    <filter inScope="true" ambiguous="false" inQuery="false" qualification="Dimension">

        <id>DP0.DOda</id>

        <value>Florida</value>

    </filter>

</filters>

If you just have the filter ID, then you can return all of the values for that filter by adding the ID to the request as below:

Method:   GET

URL:        http://localhost:6405/biprws/raylight/v1/documents/6781/reports/4/driller/filters/DP0.DOda

ContentType:application/xml

Response:

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>

<filter inScope="true" ambiguous="false" inQuery="false" qualification="Dimension">

    <id>DP0.DOda</id>

    <value>Florida</value>

    <lov refreshable="false" partial="false" hierarchical="false">

        <values>

            <value>California</value>

            <value>Colorado</value>

            <value>DC</value>

            <value>Florida</value>

            <value>Illinois</value>

            <value>Massachusetts</value>

            <value>New York</value>

            <value>Texas </value>

        </values>

        <columns mappingId="0">

            <column type="String" id="0"></column>

        </columns>

    </lov>

</filter>

Dan

former_member197386
Active Contributor
0 Kudos

Hello Gaurav,

Are you using:

[GET] <url>/documents/{documentId}/report/{reportId}/driller/filters

Or:

[GET] <url>/documents/{documentId}/reports/{reportId}/datafilter

Thanks and regards,

Anthony