Filter on a column field with a OLAP connection

6 posts, 1 answers
  1. Jérome
    Jérome avatar
    11 posts
    Member since:
    Dec 2014

    Posted 15 Dec 2014 Link to this post

    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
  2. Antonio Stoilkov
    Admin
    Antonio Stoilkov avatar
    530 posts

    Posted 18 Dec 2014 Link to this post

    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.

     
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Jérome
    Jérome avatar
    11 posts
    Member since:
    Dec 2014

    Posted 19 Dec 2014 in reply to Antonio Stoilkov Link to this post

    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

  5. Answer
    Konstantin Dikov
    Admin
    Konstantin Dikov avatar
    1793 posts

    Posted 24 Dec 2014 Link to this post

    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.

     
  6. Greg
    Greg  avatar
    1 posts
    Member since:
    Feb 2014

    Posted 29 Mar in reply to Konstantin Dikov Link to this post

    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.
  7. Jérome
    Jérome avatar
    1 posts
    Member since:
    Mar 2016

    Posted 30 Mar in reply to Greg Link to this post

    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

     

Back to Top
UI for ASP.NET Ajax is Ready for VS 2017