Unplanned
Last Updated: 13 Apr 2020 10:14 by ADMIN
Jose M
Created on: 02 Apr 2020 09:12
Category: PivotGrid
Type: Bug Report
1
How can I combine filters by columns and rows at the same time in pivotgrid?

First of all, we are using the 'Telerik UI for ASP.NET Core' product. We would like to ask you about the PivotGrid component, since we are having a strange behavior with the application of filters on the dimensions once the PivotGrid shows the data.

The use case is as follows:

  1. We configure the PivotGrid applying two dimensions, one in a column (‘family_name’) and the other in rows (‘bc_name’) and select a measure (‘Amount’), and the PivotGrid is generated as expected. (see Case1.png)
  2. We apply one filter to the columns, for example ‘family_name’ contains ‘OJOS’, and the PivotGrid is refreshed showing only the data filtered as expected. (see Case2.png and Case3.png)
  3. We apply another filter to the rows, for example ‘bc_name’ contains ‘Barrios’, and the PivotGrid is refreshed showing only the data filtered by that filter, but no for the combination of the filter of ‘family_name’ applied before. (see Case4.png and Case5.png)

As you can see, the behaviour is strange, because we we can’t see the data with the application of both filters in combination.

I also included the code where we build the PivotGrid, if that can help to see the problem. (see Code.txt)
Hope that you can help us, because that is a real inconvenient for us.

 Thanks in advance.

 

3 comments
ADMIN
Alex Hajigeorgieva
Posted on: 13 Apr 2020 10:14

Hi, José,

I have now made this item public and it is available at:

https://feedback.telerik.com/aspnet-mvc/1460211-how-can-i-combine-filters-by-columns-and-rows-at-the-same-time-in-pivotgrid

You may also follow it in the repository if you prefer using GitHub here:

https://github.com/telerik/kendo-ui-core/issues/5707

Finally, as a token of appreciation for helping us improve, I have added some Telerik points to your account.

Kind Regards,
Alex Hajigeorgieva
Progress Telerik

Progress is here for your business, like always. Read more about the measures we are taking to ensure business continuity and help fight the COVID-19 pandemic.
Our thoughts here at Progress are with those affected by the outbreak.
Jose M
Posted on: 07 Apr 2020 12:59

Hello Alex,

Many thanks for your response. 
We will continue with the project where we found the issue the next week and i think that we will don't have problems with including the solution that you have provided us.

And, of course, you can convert this thread to a public item, so that others can find and upvote it. But, please, remove the files before doing that.

Kind regards

José Miguel Serrano

Project Manager

ADMIN
Alex Hajigeorgieva
Posted on: 07 Apr 2020 08:52

Hello, José,

Thank you very much for the provided screenshots and the code snippet and for bringing this to our attention.

I am able to reproduce this behaviour only with the flat dataBinding demo, not with the OLAP option. I found that this might be caused by the lack of a logic operator in the filter and was able to remedy the behaviour by extending the filter to contain it in the DataBinding event of the PivotGrid:

.Events(e=>e.DataBinding("onDataBinding"))

function onDataBinding(e){
    var pivot = this;
    var filter = pivot.dataSource.filter();
    if(filter && filter.filters.length > 1 && !filter.logic){
        e.preventDefault();
        var fullFilter = $.extend({logic: "and"}, filter);
        pivot.dataSource.filter(fullFilter);
    }
}

You can test it in this Dojo by uncommenting the event:

https://dojo.telerik.com/@bubblemaster/oyUlOxAg

Since this appears to be a bug, would you mind if I convert this thread to a public item, so others can find and upvote it. Naturally, I can remove the files before doing that. Alternatively, I will create a new item on your behalf.

The items that are most popular and in high demand are the first ones to be fixed.

Let me know what you think.

Kind Regards,
Alex Hajigeorgieva
Progress Telerik

Progress is here for your business, like always. Read more about the measures we are taking to ensure business continuity and help fight the COVID-19 pandemic.
Our thoughts here at Progress are with those affected by the outbreak.