cancel
Showing results for 
Search instead for 
Did you mean: 

In Lumira Designer or Design Studio - How to capture 1st row of crosstab

fathe
Explorer
0 Kudos

Hi Experts

I have a ds1 contains Country - Cirty - count(Population). which always brings top 10 rows of data assigned to crosstab. and Region is Dim Filter.

there is another query Ds_2 in which it has most detail level information like District / Area and count. for which Country and City are the Filters.

Both queries should run one after another (Process Group 1,2). For DS_2 query we need to pass filter (Country, City) should be top 1st record of crosstab.

Please Help!

chandrasekhar6
Participant
0 Kudos

Hi Hussain,

Can you explain detailed "For DS_2 query we need to pass filter (Country, City) should be top 1st record of crosstab" for this highlighted one.

sapna_jgurudutt
Active Contributor
0 Kudos

Hi,

I understand that you are using Lumira Designer with regard to this issue. Is my understanding correct? If yes, can you clarify regarding the exact version, SP level and Patch level you are using for Lumira Designer with regard to this issue?

Thanks & Regards,

Sapna

Accepted Solutions (0)

Answers (4)

Answers (4)

former_member234401
Active Participant

Try if this one could help

var dim ="DS:2,DIM:id_52";

var members = DS.getDataSelections({"DS:2,DIM:id_52":"?"});

members.forEach(function(sel, index){

if(index == 0){

mem = DS.getMember(dim, sel).internalKey;

mem_t = DS.getMember(dim, sel).text;

}});

br

René

former_member234401
Active Participant
0 Kudos
As I recall - getDataSelections - is only available in Lumira Designer. And not in Design Studio

in 2.2 you can code the getDataSelection JSON string. There is a convert function.

fathe
Explorer
0 Kudos

Thanks Nikhil. Our source is Universe. I don't find the option.

fathe
Explorer
0 Kudos

Hi Nikhil

can you please explain in detail? Thanks

nikhil_joy2
Active Contributor
0 Kudos

Hi Hussain,

You have option to create dynamic key figures in edit initial view of data sources. You can right click and create a dynamic calculation "rank" for population key figure. Then in your script, capture Country dimension and inside the array, use getData() function to capture the rank key figure and check IF condition rank ==1.element in the array satisfying this condition is your first row in crosstab as the crosstab has top 10 list based on population. you can assign this element to a variable and use as filter for your DS_2.

Regards,

Nikhil Joy

nikhil_joy2
Active Contributor
0 Kudos

Hello Hussain,

You can capture the first record by creating a dynamic calculation "rank" in your DS_1 based on Population. Use a simple array to get the country list and check newly created rank formula value == 1 condition, and capture corresponding array element into a variable. This will be the country as the row 1 in your cross tab. If you define this piece of code as a function, you can call it every time you change Region selection.

Regards,

Nikhil Joy