It's all about the answers!

Ask a question

Report Builder custom expression using LQE Examples


2
1
Richard Good (872861) | asked May 30 '19, 10:04 a.m.
edited May 30 '19, 10:07 a.m.

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

One answer



permanent link
Richard Good (872861) | answered May 30 '19, 11:21 a.m.
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))))


Your answer


Register or 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.