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

Conditional statement in Custom Expressions

How do I write conditional statements in Custom Expressions. I am using Data Warehouse and my requirement is that I need to set value as 'High' if my value comes to 3, 'Medium' if value is 2, else 'Low'.

0 votes


Accepted answer

Permanent link
Hi, you can use a Case statement in your custom expression -- my example is built for a DB2 database, but I think the SQL should be applicable across DB systems.   In my example I'm doing grouping by creation date, but you could substitute your attribute and text as appropriate.

CASE WHEN AGE(DATE($Work Item:Creation Date$)) < 11 THEN 'Age 0-10' WHEN (AGE(DATE($Work Item:Creation Date$)) > 10 AND AGE(DATE($Work Item:Creation Date$)) < 21) THEN 'Age 11-20' WHEN (AGE(DATE($Work Item:Creation Date$)) > 20 AND AGE(DATE($Work Item:Creation Date$)) < 31) THEN 'Age 21-30' ELSE 'Age +30' END
Mohit Agrawal selected this answer as the correct answer

0 votes

Comments

Thanks @Jackie for an prompt answer

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
× 362
× 9

Question asked: Mar 30 '22, 8:28 a.m.

Question was seen: 1,595 times

Last updated: Mar 30 '22, 9:04 a.m.

Related questions
Confirmation Cancel Confirm