Where does [Interest Rate] come from ? (it's not in your 4 original fields)
Comes from another dataset.
OK, I'm guessing:
IF [1 (ML_Output)].[Variable Name]= "Interest Rate" THEN [Interest Rate] END
but there could be other things interfering with that.
Can you convert the measure to a dimension after creating it ?
You need to aggregate your measures
IF ATTR([1 (ML_Output)].[Variable Name])= "Interest Rate" THEN SUM([Interest Rate]) END
Parameters are static in nature in tableau. Whenever new data comes you need to recreate/refresh the parameter values.
Use SUM() instead of ATTR() to aggregate the Interest Rate.
Give a try and let us know if this help else share some sample mock up data in packaged workbook.
Good morning Pedro
I would like to see the data behind the calculation but there are a couple things going on
in the first statement Attr(....) is an aggregating function so you need so interest rate needs to be aggregated - don't know the calculation but min(), max(), avg(), sum() are among the options
the other issue is that attr() in the last formula will not result in a number (think like a label) you need to use min,max,sum,avg, or any other aggregating function that returns a number
If this posts assists in resolving the question, please mark it helpful or as the 'correct answer' if it resolves the question. This will help other users find the same answer/resolution. Thank you.
Try using the below
IF ATTR([1 (ML_output)].[Variable Name]) = "Interest Rate" THEN STR([Interest Rate]) END.
In case you want to show the interest rate in %, then use STR(ROUND(SUM([Interest rate])*100,2))+"%"
That calculation throws the cannot mix aggregated and non-aggregated fields.
[Interest Rate] is a string, I can't use SUM().
if interest is a string you will need to convert it to a number to use in a numeric calculation and then aggregate accordingly based on the needs of your analysis
Does it contains numeric values? If so then you can use SUM(INT([Interest Rate]))