on 08-31-2015 7:18 AM
hi,
I am new to SAP design studio.I have a requirement where ,I have a crosstab which changes the data dynamically based on the selection in the dropdown.
I tried to achieve this using scripting.I used assign data source method to dynamically change the crosstab contents,after that i used some script like
DS_6.getMembers("[Measures]", 100);
In place of measures,the filed name should be dynamic.
Is there any inbuilt function to count the number of rows of a crosstab.If there is any ,please do let me know.
Thanks,
Deepa
To change the crosstab contents based on your selection you can use
Datasource.setFilter(Dimension, Value);
In order to know the number of rows Right click on the datasource->Edit Initial View-> Right click on any one of the measure ( eg Measure1) Display result As ->Total Number of Detailed Values
Now use the following script o get the number of rows
Datasource.GetdatAsString(Measure1,{ }); This script will return the result row of Measure1 which is your count.
Hope this helps
- Karthik S
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Ok I was not aware of that you are using HANA datasource.. Now Just a thought.. You can try some logic like this-
var a= DS.getMembers("Dimension",maximumNumber);
var count=0;
a.forEachFunction((element,index)
{
if(DS.getdataAsString("Measure",{Dimension :element.internalKey} )!="")
{
count=count+1;
}
);
I found this as a nice option to count the number of records in a datasource:
var getarray = DS_1.getMembers("DataSource", 10000);
var membercount = getarray.length;
// "10000" to set a max
//To display the value in text object
//convert to string using +""
var membercountstring = membercount+"";
TEXT_1.setText(membercountstring);
User | Count |
---|---|
90 | |
10 | |
10 | |
10 | |
7 | |
7 | |
6 | |
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.