KitWallace / AIDVIEW-DB

A repository, browser and API for IATI activities
1 stars 0 forks source link

Error while evaluating expression #124

Open benfoxall opened 10 years ago

benfoxall commented 10 years ago

I'm getting this problem when accessing this query:

http://data.aidinfolabs.org/xquery/woapi.xq?Reporter=GB-CHC-1079599&format=json&groupby=Country&result=values

err:XPTY0004 Error while evaluating expression: ($activity/recipient-country[@iati-ad:country= $code ]/@iati-ad:project-value div $activity/@iati-ad:project-value). Too many operands at the left of div [at line 281, column 25, source: String]
In function:
    api:compute-project-value(item()*, item()*, item()*, item()*) [296:42:/db/apps/iati/lib/api.xqm]
    api:group-summary(item()*, node(), element()*, element()) [317:5:/db/apps/iati/lib/api.xqm]
    api:group-by-facet(element(), xs:string, element()*) [588:19:/db/apps/iati/lib/api.xqm]
    api:select-groups(item()*) [633:27:/db/apps/iati/lib/api.xqm]
    api:api(item()*) [4:8:/db/apps/iati/lib/api.xqm]

This is causing an error on the aidview app on the page:

http://aidview.net/activities-map?Reporter=GB-CHC-1079599&view=false

(which is accessible by clicking the "view on map" button at the bottom of http://aidview.net/activities?Reporter=GB-CHC-1079599 )