Subscribe Bookmark RSS Feed

Conditional Formatting If and print result

adam

Contributor

Joined:

Sep 20, 2017

I am setting up few criterias for a Pass/Fail result with IF AND statement as shown below:

 

If( :Criteria 1 == 0 & (:Criteria 2 == 0 & (:Criteria 3 == 0 & :Criteria 4 == 0)),
0,
1
)

 

For the result, it return as either 0 or 1. I would like to know is it possible to change it to Pass or Fail instead of just 0 or 1.

 

Thanks. 

2 ACCEPTED SOLUTIONS

Accepted Solutions
ian_jmp

Staff

Joined:

Jun 23, 2011

Solution

Looks like you are using a formula to define a new (Numeric) column. In which case you can use an appropriate value label to recast the appearance of the values. Else you could use a Character column and have values as "Pass" and "Fail" strings.

uday_guntupalli

Community Trekker

Joined:

Sep 15, 2014

Solution
dt << New Column("Result",Character,Continuous,Formula(If( :Criteria 1 == 0 & (:Criteria 2 == 0 & (:Criteria 3 == 0 & :Criteria 4 == 0)),
	"Fail",
	"Pass"
  )))

Try this . I think Ian is referring to this .. 

Best
Uday
3 REPLIES
ian_jmp

Staff

Joined:

Jun 23, 2011

Solution

Looks like you are using a formula to define a new (Numeric) column. In which case you can use an appropriate value label to recast the appearance of the values. Else you could use a Character column and have values as "Pass" and "Fail" strings.

uday_guntupalli

Community Trekker

Joined:

Sep 15, 2014

Solution
dt << New Column("Result",Character,Continuous,Formula(If( :Criteria 1 == 0 & (:Criteria 2 == 0 & (:Criteria 3 == 0 & :Criteria 4 == 0)),
	"Fail",
	"Pass"
  )))

Try this . I think Ian is referring to this .. 

Best
Uday
adam

Contributor

Joined:

Sep 20, 2017

Thank you very much Ian and Uday. It works as expected :)