on 01-27-2015 2:57 PM
I am looking for a way to display the date range
TEXT_27.setText(DS_1.getFilterText(min"0CALMONTH"))+ " - "+DS_1.getFilterText(max"0CALMONTH"));
Of course there is no min or max available but that's the logic I am trying to reach.
I have checked different threads such as
But they are all based on displaying a date range based on dropdown lists or filters from within design studio.
However in this case, the 0CALMONTH is already filtered by a variable in bex so there is no selection from within the design studio application.
Any ideas on how to display the minimum month and the maximum?
Hi,
If your "0CALMONTH" is in "yyyyMMdd" format then
use forloop here .
var MyDates = DS_1.getMembers("0CALMONTH",1000);
var MyDates_Count = MyDates.Length();
var MyDates_Min = "";
var MyDates_Max = "";
MyDates.foreach(function(MyDates_e, MyDates_i) {
if(MyDates_i==0){
var MyDates_Min = MyDates_e.text;
}
else if (MyDates_i==MyDates_Count){
var MyDates_Max = MyDates_e.text;
}
}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
thanks, that's exactly what I needed.
Just a clarification, how do you display MyDates_Max?
because in this script, TEXT_2 only shows MyDates_Min:
var MyDates = DS_1.getMembers("0CALMONTH",1000);
var MyDates_Count = MyDates.length;
var MyDates_Min = "";
var MyDates_Max = "";
MyDates.forEach(function(MyDates_e, MyDates_i) {
if(MyDates_i==0){
MyDates_Min = MyDates_e.text;
}
else if (MyDates_i==MyDates_Count){
MyDates_Max = MyDates_e.text;
}
});
TEXT_2.setText(MyDates_Min+" - "+MyDates_Max);
Hi Nikhil,
I have a similar requirement. But I do not have any variable defined in my BEX query.
I need to get the maximum 0CALMONTH value and then have to apply it as a filter to another BEX query.
Actually I am unable to get the maximum value. Can you please help me modify the above code a bit so that I can get the maximum value.
Thanks,
Shaunakh Sen
Hi Alexandre,
There is a function called DS_X.getVariableValue can you try that out?
Regards,
Fazith Ali Z.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
| User | Count |
|---|---|
| 3 | |
| 3 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.