3 Replies Latest reply on Mar 7, 2018 10:33 PM by Devhuti Kumari

# Display points on a graph using a parameter

I want to use a parameter to display circles with data for the x axis for several lines of continuous data (see below):

My question is, why didn't my first expression work? When I built it using this:

if (([Years of Followup]) =  [Years])

then

({FIXED [Risk Category],[Years]: min([% Patients Free of Distant Recurrence])})

ELSE NULL

END

I got a lot of cases where the Boolean part of the expression failed to pick up true values. I had to jury rig it as follows,

if (([Years of Followup]) - [Years]) < 0.01 and (([Years]) - [Years of Followup]) < 0.01

NOTE: The [Years] field is a single decimal value increasing by 0.1 across the full range from 0-16.

Thanks for any insight!

Stefan

• ###### 1. Re: Display points on a graph using a parameter

Hi, Stefan

If you convert the Year and your parameter into string, you will find the decimals are different, to avoid this, I will suggest to use Round() in comparing the float data a shown below Hope this helps

ZZ

• ###### 2. Re: Display points on a graph using a parameter

Not 100% sure but nature of Parameter is Continuous hence acting correct with if (([Years of Followup]) - [Years]) < 0.01 and (([Years]) - [Years of Followup]) < 0.01 ..... (I will have a look later)

• ###### 3. Re: Display points on a graph using a parameter

Hi Stefan,

Though you have kept single decimal for both Years & parameter when you use these in calculated fields it does not refer format you have set as independent field and in your case years is at 2 decimal and parameter is at 3 decimal when it is getting used in calculated field.

So you have to make them in same decimal again in formula as below:

if round([Years of Followup],2) =[Years]

then

({FIXED [Risk Category],[Years]: min([% Patients Free of Distant Recurrence])})

ELSE Null

END

Note: if you want to test it you can create 2 calculated field using years and parameter and keep them in tool-tip you will see different decimal for both.