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

if else condition in RRDI query

I have 2 columns in a query in RRDI (column a & column b). i want to insert a data item with the if else condition. The condition is if the value in column a is equal to column b then print no change else print the value of column a itself. Can you please help me with the syntax of this if else condition.I am facing difficulty with the else statement. It is not allowing me to print the value of column a. However if I enter some string over there, it works fine.

0 votes



2 answers

Permanent link
Hi Naveen Chandani,

You must to observe what kind of data you are printing.

For example:

     if the column A is a string


if (column A = column B) then ('1') else (column A)

    if the column A is integer

if (column A = column B) then (1) else (column A)


Note the quotes when you use a string column.


1 vote

Comments

How about a date comparison?

Try this

if ([Creation Date] > '01/01/2012') then ('01/01/2012') else ([Creation Date])

make sure that the date printed is a valid date


Permanent link
Try this

if ([Creation Date] > '01/01/2012') then ('01/01/2012') else ([Creation Date])

make sure that the date printed is a valid date

0 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
× 6,121
× 403
× 51

Question asked: Jul 01 '12, 1:08 a.m.

Question was seen: 6,319 times

Last updated: Nov 28 '13, 2:36 a.m.

Confirmation Cancel Confirm