This is a migrated thread and some comments may be shown as answers.

Filter on a column field with a OLAP connection

5 Answers 125 Views
PivotGrid
This is a migrated thread and some comments may be shown as answers.
Jérome
Top achievements
Rank 1
Jérome asked on 15 Dec 2014, 01:22 PM
hi,

I have a pivotgrid connected to an OLAP cube.
I have placed on the columns fields the Year field and I wish to filter this field on a specific year in Code-behind in C #

I browsed the online documentation and the forum but I have not found the proper use for the methods FilterByLabel, FilterByValue, SetFilterIncludes.
I think that the examples provided are suitable for connections to relational databases but not multidimensional.

Could someone tell me how I can implement that kind of filter.

thank you in advance

best regards

5 Answers, 1 is accepted

Sort by
0
Antonio Stoilkov
Telerik team
answered on 18 Dec 2014, 11:29 AM
Hi,

In the help article below is described how to use the filtering methods.
In your case you could use the FilterByLabel or SetFilterIncludes method as shown below to filter the data.
this.RadPivotGrid1.FilterByLabel(PivotGridFilterFunction.Equals, RadPivotGrid1.Fields["Year"], "FY 2006");
this.RadPivotGrid1.SetFilterIncludes("Year", new List<object>() { 2006 });
this.RadPivotGrid1.SetFilterIncludes("Year", new List<string>() { "2006" });

Regards,
Antonio Stoilkov
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
0
Jérome
Top achievements
Rank 1
answered on 19 Dec 2014, 09:55 AM
Hi Antonio

first, thanks for your answer.

i have already tested the 3 methods you mentioned and it didn't work because my pivotgrid is connected to a OLAP cube and the filter has to be done on a member value, not on a label nor a value.

the screenshot attached to this post shows the filter set manually by manipulating the pivotgrid.

and I would like to be able to do the same programatically server-side.

Is there a way?

thanks

Regards

0
Accepted
Konstantin Dikov
Telerik team
answered on 24 Dec 2014, 02:12 PM
Hello Jérome,

The approach that Antonio have suggested with the RadPivotGrid1.SetFilterIncludes should get you the desired result, but I have tested it locally for the Year and I have noticed that for some reason it does not apply the provided year to the Include collection:
protected override void OnPreRender(EventArgs e)
{
    base.OnPreRender(e);
    this.RadPivotGrid1.SetFilterIncludes("FiscalYear", new List<object>() { 2009 });
}

If you apply the same to a String field you can see that it is working correctly.

I will forward this to our developers, so they could further investigate what could cause the issue with the Year field.

Please excuse us for any inconvenience caused by this.


Regards,
Konstantin Dikov
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
0
Greg
Top achievements
Rank 1
answered on 29 Mar 2016, 03:49 PM
I know this is a year and a half old thread, but is there a resolution to this?  I can successfully set filter includes on string and integer fields but when I try on a PivotGridColumnField defined with GroupInterval="Year", the RadPivotGrid acts as if none of the includes are selected.
0
Jérome
Top achievements
Rank 1
answered on 30 Mar 2016, 12:00 PM

Hi Greg,

SetFilterIncludes works

as I used a connection to an OLAP cube, the items in the list had to be to the right format

in my exemple : this.RadPivotGrid1.SetFilterIncludes("Year", new List<object>() { [Annees].&[2006] });

Regards

 

Tags
PivotGrid
Asked by
Jérome
Top achievements
Rank 1
Answers by
Antonio Stoilkov
Telerik team
Jérome
Top achievements
Rank 1
Konstantin Dikov
Telerik team
Greg
Top achievements
Rank 1
Jérome
Top achievements
Rank 1
Share this question
or