How do I display/output a count of records by country (a sha

Posted by Rollbase User on 20-Sep-2010 14:24

How do I display/output a count of records by country (a shared picklist)?

All Replies

Posted by Admin on 20-Sep-2010 15:20

if you know the code of country you can run (on server or on client) selectNumber API with query:

select count(1) from ... where country='DE'

Currently we do not have API which gives a list of all available picklist items, but we may add this in the future.

Posted by Admin on 20-Sep-2010 15:22

I just want a report of how many records I have in each country, not filtered by only one country.

I can easily make a chart that shows this, but I can't figure out how to do it simply to produce a report where I can view a table or excel.

Posted by Admin on 20-Sep-2010 15:24

My example does not filter records, it calculates number of records for given condition.

Posted by Admin on 20-Sep-2010 15:31

Ok, let me re-phrase my question.

What is the easiest way to produce a table, generated for an object with the "Location" attribute, with 2 columns: Country, NumRecords(that have row's country selected)

It's easy to do with the chart tool, I just select the X-axis as Country, and the Y-axis as "# of ObjectName"

This seems like a very simple output, am I complicating my request?

Posted by Admin on 20-Sep-2010 16:31

You may need to hard-code a list of countries (we currently don't have API for that). Than create server-side JavaScript, something like this:


var buff = "";
for (var k=0; k
var cnt = rbv_api.selectNumnber(
"select count(1) from Location where country='"+codes[k]+"'");
buff += "Counter for "+codes[k]+": "+cnt+"\n";
}
return buff;

Posted by Admin on 20-Sep-2010 16:37

How do I get this in table format: - (i easily made this chart with the built-in chart function, why is it so hard to get into a table?)

IMAGE:

This thread is closed