0
votes

I have two Measures in Tableau, “Initial Loan Rating” and “Final Loan Rating”. Each of these two measures will use one of four ratings in them (Pass, Minor, Moderate, Severe). All of the “Initial Loan Rating” measures will have at least one of the four ratings. However, the “Final Loan Rating” measure not always will have this field populated.

I’m trying to create a calculated field that will look at the “Final Loan Rating” measure, IF field is empty THEN populate what is shown in the “Initial Loan Rating” measure. ELSEIF “Final Loan Rating” has something populated THEN show what is populated.

I know how to do this in Excel with the following formula =IF(b2<>””,B2,A2) I’m just having difficulty translating this to Tableau language.

2

2 Answers

1
votes

Assuming that the mentioned measure names are your actual field names in Tableau, below formula will do what you need:

IF [Final Loan Rating] = "" THEN [Initial Loan Rating] ELSE [Final Loan Rating] END
0
votes

If in your scenario "empty" means null (assuming you're dealing with numbers) I would suggest the pre-built IFNULL function

IFNULL(expr1, expr2)

In your example:

IFNULL([Final Loan Rating], [Initial Loan Rating])