Jump to content

This topic is 3873 days old. Please don't post here. Open a new topic instead.

Recommended Posts

Posted

Hi There,

 

I need some help with performing a calculation on a field in a table based on the contents of another field in the same table.

 

The field I want base my calculation on is call Status whose content comes from a radio button set in a layout.

The radio button set has three options Outstanding, Won and Lost.

 

So I created a field called Outstanding set Type to Calculation and inserted the calculation: Case(Status = "Outstanding";1;0).

 

When I display the field in a report all the rows show the value as 0 when at least 50% of the should display 1 and the Status field displays one of the three options.

 

Then when I modified the calculation to use a different field (Sales Person) with a value of "JQ" it works as expected.

 

So my question is when performing the calculation based on a Radio Button Set do you have to base it on the Option Number and not the value.

 

I hope this makes sense.

 

Kind regards, Mark.

 

 

 

Posted

If the calculation returns 0, then Status ≠ "Outstanding". Which means that your data is not what you think it is. It could contain other values that are not displayed because the field is formatted as a radio button set. Or a trailing space or carriage return. Or any kind of garbage.

 

 

---

BTW,

 Case(Status = "Outstanding";1;0)

is a superfluous way to write:

Status = "Outstanding
Posted

 

If the calculation returns 0, then Status ≠ "Outstanding". Which means that your data is not what you think it is. It could contain other values that are not displayed because the field is formatted as a radio button set. Or a trailing space or carriage return. Or any kind of garbage.

 

 

---

BTW,

 Case(Status = "Outstanding";1;0)

is a superfluous way to write:

Status = "Outstanding

Many thanks for your response.

 

I changed the calculation to use IF PatternCount >0 then 1 else 0, which works.

 

Regards, Mark.

Posted

I changed the calculation to use IF PatternCount >0 then 1 else 0, which works.

 

IMHO you should investigate the problem rather then sweep it under the carpet, so to speak.

Posted

IMHO you should investigate the problem rather then sweep it under the carpet, so to speak.

 

I have found what my problem was:

 

I was using RightValues( Self ; 1 ) to input the radio set button value which causes a carriage return to be added to the end of the value.

I found out that by using GetValue( Self ; ValueCount( Self ) ) stops the carriage return being added to the end of the value.

 

I have tested and it works with my original calculation.

 

Regards, Mark.

This topic is 3873 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.