Calculated Fields won’t work properly
30 April, 2014
Hi There:
I've tried creating this calculated field at both the view and report level: ( ( SubTotal - Order Cost ) / SubTotal ) * 100. This is just a simple Gross Margin calculation. The SQL is valid, and the data page in the view shows the correct results, however when I try to use either calculated field in my report YF tells me "an error occurred retrieving the results from the database." I find this strange since the view is able to calculate and display the proper value on the data page.
How would I generate the report XML for you to look at?
Any assistance would be helpful, thanks!
Randall
I've tried creating this calculated field at both the view and report level: ( ( SubTotal - Order Cost ) / SubTotal ) * 100. This is just a simple Gross Margin calculation. The SQL is valid, and the data page in the view shows the correct results, however when I try to use either calculated field in my report YF tells me "an error occurred retrieving the results from the database." I find this strange since the view is able to calculate and display the proper value on the data page.
How would I generate the report XML for you to look at?
Any assistance would be helpful, thanks!
Randall
Hi
If one of your inputs to the equation is also a calculated field, I think it might be a problem with version 7.
In v 6.3, it became possible to create a calculated field using another calculated field as an input. I think this might have been lost in v 7. I will be interested to see a response from Support saying whether this is the case.
Regards
Paul
If one of your inputs to the equation is also a calculated field, I think it might be a problem with version 7.
In v 6.3, it became possible to create a calculated field using another calculated field as an input. I think this might have been lost in v 7. I will be interested to see a response from Support saying whether this is the case.
Regards
Paul
Yes, order cost is a calculated field. I've been having trouble using calculated fields in calculated fields, even though I read that YF allows this now. I can use the calculated field in a formula, it's just that the formula doesn't return the expected result.
Thanks,
Randall
Thanks,
Randall
Hi Paul,
regarding calculated fields within calculated fields, I've just checked this YF 7 and it was definitely still working in my installation. Could you please check that your calculated field has the Calculations permission enabled in the Access tab of Step 2 of the View Builder as shown below:
regards,
Dave
regarding calculated fields within calculated fields, I've just checked this YF 7 and it was definitely still working in my installation. Could you please check that your calculated field has the Calculations permission enabled in the Access tab of Step 2 of the View Builder as shown below:
regards,
Dave
To the Guest (after Paul's post),
could you please have a read of this other forum post and see if what is discussed there solves the wrong results you are getting from your calculated field.
regards,
Dave
could you please have a read of this other forum post and see if what is discussed there solves the wrong results you are getting from your calculated field.
regards,
Dave
Thanks David. I will have a look at the views to see if that is where the problem lies.
Regards
Paul
Regards
Paul
Thanks David. All my fields have the Calculations checkbox checked, I think it defaults to checked in the most recent build, which I am running.
I'll look into the possibility of the integer division problem described in the other link and see what happens. I may have to cast them as float as noted there.
It would be very helpful if the YF formula builder would allow conversion of data types through either Cast or Convert. If not, perhaps you should provide a built-in converter to convert from integer to numeric. Just a thought...
Thanks
Randall
I'll look into the possibility of the integer division problem described in the other link and see what happens. I may have to cast them as float as noted there.
It would be very helpful if the YF formula builder would allow conversion of data types through either Cast or Convert. If not, perhaps you should provide a built-in converter to convert from integer to numeric. Just a thought...
Thanks
Randall
Hi Randall,
Let us know how it goes.
The formula builder is only for basic calculations, otherwise you will need to use the freehand calc builder.
This is something I guess we can think about for the future, but at this point in time, there is no plan to change the calc builder.
Regards,
David
Let us know how it goes.
The formula builder is only for basic calculations, otherwise you will need to use the freehand calc builder.
This is something I guess we can think about for the future, but at this point in time, there is no plan to change the calc builder.
Regards,
David