cancel
Showing results for 
Search instead for 
Did you mean: 

Not possible to filter for more than one dimension in Datasource script filter method?

param0308
Participant
0 Kudos

Hi experts.

We have a scenario where we need to apply filter on multiple dimensions .Eg.

We have one data source DS1 with Dimension HUb and material_grp .

Now we want to filter the DS1 with HUB and Material_grp at the same time.

I am using below statement to apply filter.

DS_1.setFilterExt("ZHUBCODE", "HUB1" );

DS_1.setFilterExt("ZMAT_GRP", "MATG1" );    //Clears HUB filter and shows data for all HUBS , filter with material group only

But Setfilter method first delete the last filter and apply new one.And set filter method takes only one dimension at a time.

Please help me in this 

Accepted Solutions (0)

Answers (4)

Answers (4)

MateuszTrojanow
Explorer
0 Kudos

Hi, Rajender,

Could you share how did you resolve this problem?

I definietly cannot filter one data source on two dimensions at the same time.

The setFilter method has this limit noted in its description:

First, the existing filter is cleared, then the new filter is validated. If the new filter is valid then it replaces the cleared filter. If the new filter is invalid then the existing filter remains cleared.

In my case it matches the behaviour of the method. The second filter clears the first one.

param0308
Participant
0 Kudos

Hi Mateusz,

I did that programming in 2015. I exactly don't remember how I fixed it. But I can assure, it can be solved by rearranging the code and writing at the correct location.

If I can find it, will reply soon.

Regards

Raj

param0308
Participant
0 Kudos

Hi Mustafa,

My filter issue is resolved now .I was just doing small mistake with filter method.

Thanks for quick reply.

MustafaBensan
Active Contributor
0 Kudos

Hi Rajender,

Just as a follow-up, if you are using BW as a data source, make sure for each of the dimensions, ZHUBCODE and ZMAT_GRP, that in the Initial View Editor of the data source, the Members for Filtering > Only Values with Posted Data option is selected, which should be the default anyway.

Again if you are using BW, the other option you could try is to use the internal key for filtering with setFilter instead of setFilterExt.  Is there a particular reason why you are using the external key?

Regards,

Mustafa.

Former Member
0 Kudos

Hi Mustafa,

I get the same problem with a requirement to filter two different dimension in a DS

Coming from other discussion related to cascade filter you solve it:

With DS coming from BW,

Imagine If we have a chart that is getting data from DS_OPORTUNITY

I would need to filter:

DS_OPORTUNITY.setFilter("ZCREP", varRepre);

and

DS_OPORTUNITY.setFilter("0CALMONTH", var_month);

Are the double filtered not working for that porpouse?

I can not see the cascade filter applying to the requirement.

Can you help me on that?

thank you

MustafaBensan
Active Contributor
0 Kudos

Hi Oscar,

The double filters should definitely apply for a BW data source.  Can you post a new SCN question with the details of your scenario and we can work through it again .

Regards,

Mustafa.

param0308
Participant
0 Kudos

Hi Oscar,

I had the same problem .you must be using only text as input use internal ID of the selected dimension value.

Ex. Let's say u have a chart C1 , with dimension D1.

Now on select of one value in chart C1 you can use code: datasource1.setfilter( D1, getselectedvalue( D1).internalkey).

Try this one.Same way you can apply filter on more than one dimension in one data source.

param0308
Participant
0 Kudos

Datasource.setfilter( dimension , chart.getselctedvalue().internal key)

Datasource.setfilter( dimension , "value1");

Multiple value

Datasource.setfilter( dimension , {"value1"," value2"})

Former Member
0 Kudos

Hi Rajender,

It seems you are filtering two diferents values from the same dimension on DS.

What about you have this scenario?

D1, D2 to filter in Chart C that is using datasource1

I open a new post discussion with it as Mustafa required

MustafaBensan
Active Contributor
0 Kudos

Hi Rajender,

It sounds like you are trying to implement a cascading filter, which is definitely possible with a BW data source.  From the dimension names, it looks like you are in fact using BW but can you confirm this?  If you are using a universe as a data source then an alternative approach is required.

Regards,

Mustafa.

vincentdechandon
Contributor
0 Kudos

Hi.

Seems like with DS 1.6 SP01 cascading filters work also for Universe.

Correct?

MustafaBensan
Active Contributor
0 Kudos

Hi Vincent,

I have not had a chance to check this myself but if you're finding cascading filters works for Universes in DS 1.6 SP01 then I think that's great news!  Perhaps you could write a blog to share your experience with it?

According to the latest Design Studio Roadmap, "Support of cascading filters for UNX and CSV data sources" is listed as a Planned Innovation, so I was expecting it to be included in DS 1.6 SP02 but perhaps they have managed to sneak it in earlier.

Thanks,

Mustafa.