Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
THRUST SERVICES & TOOLS
CLOUD EDITIONS
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Intelligence (Analytics)
Concatenate function improperly formatting numbers
kevinshih
Hi all,
Using the CONCATENATE function to generate a list of numbers in a computed column for a record set. Basically I wanted to string together the primary key values into a comma-separated string that I then pass into another recordset as part of it's where clause.
What I've found is the concatenate function is adding commas so that the end result of the string (assumming unique keys are 998, 999, 1000, 1001) looks like:
998, 999, 1,000, 1,001
The separator expression I am using is ", ".
Any ideas on how to force the concatenate function to not format the primary key values with commas?
If not, any ideas on achieving the same goal?
Find more posts tagged with
Comments
mwilliams
Hi kevinshih,
You could try building the comma separated string on your own through script rather than using the aggregation function.
kevinshih
I used the following solution:
In the beforeOpen method of the dataset, I put:
reportContext.setGlobalVariable("resourceInterfaceList", "");
In the onFetch method I put:
// Set the global variable for the list of interface resource OIDs
var newInterfaceList = "";
var interfaceList = reportContext.getGlobalVariable("resourceInterfaceList");
if (interfaceList.equals("")) {
newInterfaceList = new String(row.OID);
}
else {
newInterfaceList = interfaceList + ", " + new String(row.OID);
}
reportContext.setGlobalVariable("resourceInterfaceList", newInterfaceList);
Seems to solve the problem. Thanks for the hint.
mwilliams
Great, glad to hear. If this method causes any other issues, let me know.