WKA
WKA

Reputation: 11

SPARQL - evaluate an IF-expression within a query

I am working as an informal team lead (team handles specific type of tasks in the project) for a project which uses IBM RTC for change management. Now, I have created various queries/reports to streamline how I get the information I need for the weekly status slides of my team.

The problem I encounter is the following. In the the tasks there is an "effective estimate" (not an task attribute!) which is calculated as "if 'correction'-value exists, then use 'correction'-value, else use 'estimate'-value".

So as soon somebody adds a "correction" then my "total estimates"-query will no longer provide the correct result.

What I expect/need:

possible solution in the query/report-editor: As I cannot query the "effective estimate", I did try to use a custom expression, based on the SPARQL syntax I could find. The report editor does validate this as formally correct, but as I have no SPARQL-experience I cannot tell where the actual problem is.

SUM( IF($Task:Correction$ > 0, $Task:Correction$, $Task:Estimate$) ) /3600000

What I get:

What I already tried (leading in the best case to the "What I get" above):

Upvotes: 1

Views: 81

Answers (0)

Related Questions