Jazz Forum Welcome to the Jazz Community Forum Connect and collaborate with IBM Engineering experts and users

Report Builder custom expression using LQE Examples

Hello,

I'm struggling to create what would be very simple in code with SPARQL  (I imagine) and this custom expression editor.

What I want to do is translate a status attribute on child tasks into a percentage complete value, so I have a Status attribute with values of say, Open =0%, In Work= 20%, In Review=80% and Closed = 100%

So I can grab the status
$Task:Status$
Then I want to translate that to the percentage equivalent and average it, the logic is something like the following

$statusVal=0
if($Task:Status$="Open") $statusVal = 0
elseif($Task:Status$="In Work")$statusVal = 20
elseif($Task:Status$="In Work")$statusVal = 80
elseif($Task:Status$="In Work")$statusVal = 100
AVG($statusVal)

Anyone have any clue how to do this in SPARQL?
I have had a look at the specification, but don't really want to read a massive document

This is to give metrics on projects where personnel don't fill in how much time they spend on a task, it will gives a rough progress estimate

Thanks for any help

Richard

1

2 votes



One answer

Permanent link
Seems it's a bit like excel, the following was what I needed. Hopefully this will help someone else, this was not obvious to me anyway!

 AVG(if($Task:Status$="New",0,(if($Task:Status$="In Progress", 20,100))))


3 votes

Your answer

Register or log in to post your answer.

Dashboards and work items are no longer publicly available, so some links may be invalid. We now provide similar information through other means. Learn more here.

Search context
Follow this question

By Email: 

Once you sign in you will be able to subscribe for any updates here.

By RSS:

Answers
Answers and Comments
Question details
× 12,019
× 481
× 73

Question asked: May 30 '19, 10:04 a.m.

Question was seen: 4,460 times

Last updated: May 30 '19, 11:21 a.m.

Confirmation Cancel Confirm