July 17, 201411 yr 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.
July 17, 201411 yr 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
July 17, 201411 yr Author 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.
July 17, 201411 yr 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.
July 17, 201411 yr Author 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.
Create an account or sign in to comment