cancel
Showing results for 
Search instead for 
Did you mean: 

dimension selection/filtering of data in script

Former Member
0 Kudos

SAP BusinessObjects Design Studio

Release 1.6 SP1 Patch 2 (Version: 16.1.2)

Source: Relational database, thru UNX

If i create a data source with the below structure:

Product Flag A Flag B Flag C

A           1                0             0

B           0                1             0

C           1                0            0

D            0           1                0

E           0           1                0

F           0           1                0

G           1           0                0

H           1           0                0

I           0             0                1

J           0           0                  1

can we create 3 measures in script as below:

# Flag A Products = count(case when flagA = 1 then Product else null end)

flagAProductList = A;C;G;H

checked below reference links below but still couldn't solve the problem

https://scn.sap.com/thread/3490636

https://scn.sap.com/thread/3499036

Thanks,

Srikanth

Accepted Solutions (1)

Accepted Solutions (1)

MustafaBensan
Active Contributor
0 Kudos

Hi Srikanth,

It is best to create such measures directly in the universe.  Is there a reason why you are not doing that?

Regards,

Mustafa.

Former Member
0 Kudos

Thanks Mustafa for your response.


I'm trying out ways of achieving some requirements. I will have to show the counts of products as KPI's based on these flags (multi KPIs for Products shown on dashboard). Also on click of these KPIs I will have to filter the scorecards/crosstabs and other charts based on these products KPIs (say a crosstab showing all products for that region, and on click of "# Flag A Products" KPI on the dashboard, the crosstab will show only those Flag A products.)

My intention of trying this approach is to see if I can achieve counts in script as well get the concatenation of all those Flag A products and Flag B products in some global variables and pass them as setFilter to the respective chart Datasources.

Thanks,

Srikanth

MustafaBensan
Active Contributor
0 Kudos

Hi Srikanth,

One approach to achieve your requirement would be to use the SCN Design Studio Development Community Data Iterator component to loop through the rows of your data source result set and then increment corresponding flag counter variables as well as building a concatenated product string based on an if then statement.

Regards,

Mustafa.

Former Member
0 Kudos

Thanks a lot Mustafa. I finally created them in universe using derived table and able to solve it.

MustafaBensan
Active Contributor
0 Kudos

Hi Srikanth,

Happy to help.  Glad you found a solution.  As mentioned earlier, where possible it is best to perform such calculations in the back-end rather than through scripting on the client side, as you have discovered

Regards,

Mustafa.

Answers (0)