on 02-07-2019 6:15 AM
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!
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é
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks Nikhil. Our source is Universe. I don't find the option.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Nikhil
can you please explain in detail? Thanks
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
82 | |
10 | |
10 | |
9 | |
6 | |
6 | |
5 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.