In Writer/Data Sources window, I run a simple MySQL query with a single computation (sum):
SELECT c.*, (c.client_income1+c.client_income2) AS total_income
FROM client_incomes c
client_incomes table is just:
Cl_ID client client_income1 client_income2
1 Red 1000 1500
2 Brown 2000 3000
Output, in Writer Data Sources window shows, correctly:
1 Red 1000 1500 2500
2 Brown 2000 3000 5000
Create a simple document by inserting all five fields:
<Cl_ID> <client_income1> <client_income2> <Total_income>
Select top record and “Data to Fields” result in Writer document:
1 Red 1000 1500 <Total_income>
Select top record and “Data to Fields” result in Writer document:
2 Brown 2000 3000 <Total_income>
<Total_income> field does not update or change.
I run the query in “Run SQL Command Directly” mode because it is actually part of a far more complex query that must be run directly.
If I define a stored function in MySql, say to add two numbers, and return that result as part of the query, the <Total_income> field updates properly. However, my calculations are numerous and I really don’t want to redefine and store simple math functions that already are available. Besides, some calculations are not simple in the original query.
My question(s): Is there a simple way to correct this behavior without having to store a bunch of math functions? It seems that “Data to Fields” is somehow not using or unable to use the calculated field. Is this a bug?