IBM Cloudability

 View Only

 API Rounding total_amortized_cost

Jump to  Best Answer
  • Cloudability
Apptio Community Member's profile image
Apptio Community Member posted 05/20/22 11:51 AM
So I have an API v1 call I am using to pull data into Power BI. What I've noticed is if I run a report in Cloudability WEB and export the cost fields the CSV shows the field in decimal format going back multiple places. I can SUM that column and it matches the totals shown in the WEB report. In the WEB report details section it would show the rounded number but again the totals are correct.

When I run my API call I get the results as follows and not the full decimal. The API call seems to be pulling the 'Rounded Pretty" number and not the actual decimal number.

"total_amortized_cost""$0.00"

Is there a way to get the API call to not round and just give me the actual decimal values?

TIA
Mike...

#Cloudability
Apptio Community Member's profile image
Apptio Community Member  Best Answer
The answer to this was to go with the v3 API

https://api.cloudability.com/v3/internal/reporting/cost/run?dimensions=category3&dimensions=date&dimensions=vendor_account_name&dimensions=vendor&dimensions=usage_family&dimensions=usage_type&dimensions=account_identifier&filters=category==123456&filters=category==567890&filters=category==345678&limit=64000&metrics=total_amortized_cost&end=2022-05-26&start=2022-04-01

You need to have the limit parameter and the max is 64000. I use Power BI with this in a dataset that incrementally updates. The Incremental update is set to keep the last 6 quarters of data and only update the last 7 days on a daily basis so the data pull is below the 64k limit as Power BI does the pull a day at a time.
#Cloudability
Jessica Spencer's profile image
Jessica Spencer
Hi Michael, thanks for your question. I am trying to see if I can get someone from our Cloudability team to answer, I'll keep you posted!
#Cloudability
Apptio Community Member's profile image
Apptio Community Member

I'm not sure if you can unpretty a currency metric. However, as a workaround, you could make a business metric similar to below that takes the value of cost amortised and saves it as a number as opposed to currency. That could then be used in your reporting query without rounding.

{
"name": "Cost Amortised(unpretty)",
"kind": "BUSINESS_METRIC",
"numberFormat": "number",
"defaultValueExpression": "METRIC['total_amortized_cost']",
"statements": [{
"matchExpression": "DIMENSION['account_name'] != 'abcdef'",
"valueExpression": "METRIC['total_amortized_cost']"
}]
}

Business metric docs: https://help.apptio.com/en-us/cloudability/api/v3/business_mappings_endpoint.htm#business-metrics-beta


#Cloudability