Calculate SLA as a issue property

Hi Team,

I’m trying to create a SLA issue property by Priority
[Closed in SLA]:

-- annotations.group=SLA
CASE [Issue].CurrentHierarchyMember.get('Priority ID')
-- Blocker id = 1
WHEN 1 THEN [Measures].[Resove time] < 1
-- Critical id = 2
WHEN 2 THEN [Measures].[Resove time] < 4
-- Major id = 3
WHEN 3 THEN [Measures].[Resove time] < 10
ELSE [Issue].CurrentHierarchyMember.get('Priority ID')
END

[Measures].[Resove time]

-- annotations.group=SLA
 DateDiffDays(
        [Issue].CurrentHierarchyMember.get('Created at'),
        [Issue].CurrentHierarchyMember.get('Resolved at'))

But [Closed in SLA] always execute ELSE brunch. What I do wrong?

Hi @vfililppov!

When you have Issue dimension / Issue level on rows, please check what the property returns. I imagine that the IDs of the priorities are more complex than 1, 2 and 3, which is why the CASE always goes to ELSE branch.

Nevertheless, I am also wondering what you expect as a result here? In the THEN you should specify what you wish to return for when the WHEN is true. In this case in THEN you provide another check causing the result to be either true or false.

Lauma / support@eazybi.com

Hi @lauma.cirule!
I use ELSE branch for debug this property. I just want to mark issues which are not closed in SLA gate for future filtering. So it can be Boolean. Also I try to debug this and use simple values without any logical operations after THEN

-- annotations.group=SLA DEBUG
--CASE [Priority].CurrentMember.Name
CASE [Issue].CurrentHierarchyMember.get('Priority ID')
-- Blocker id = 1
WHEN 1 THEN [Measures].[Resove time]
-- Critical id = 2
WHEN 2 THEN [Measures].[Resove time] 
-- Major id = 3
WHEN 3 THEN [Measures].[Resove time] 
--  Normal id = 10000
WHEN 1000 THEN [Measures].[Resove time] 
END

Thank you for the screenshot, this helped me to see where the problem lies. The Priority ID is interpreted as string, but further comparing is with a number. Please try the following:

CASE CAST([Issue].CurrentHierarchyMember.get('Priority ID') AS NUMERIC)
-- Blocker id = 1
WHEN 1 THEN ...
END

Lauma / support@eazybi.com

Tanks a lot! It works now!

1 Like