Hi Experts,
I am facing very weird issue here. I have a simple mathematical calculation which is resulting in scientific values instead of simple 0. Please refer the diff column in the below query and result:
Query
"
SELECT
code_combination,
YTD_ACCT_BAL,
NAT_ACCT_YTD_BAL_SUM,
TARGET_BALANCE,
(YTD_ACCT_BAL/NAT_ACCT_YTD_BAL_SUM) AS PERCENTAGE,
(TARGET_BALANCE-NAT_ACCT_YTD_BAL_SUM) AS Diff
FROM STAGING_DATA;
"
Result:
Query2 Query2
the result in diff field in first row is correct however it not in second row. I have similar observation with other fields when the difference is 0. Can you please advise if I am missing some data type conversion or formatting?
Regards,
Bob
I am facing very weird issue here. I have a simple mathematical calculation which is resulting in scientific values instead of simple 0. Please refer the diff column in the below query and result:
Query
"
SELECT
code_combination,
YTD_ACCT_BAL,
NAT_ACCT_YTD_BAL_SUM,
TARGET_BALANCE,
(YTD_ACCT_BAL/NAT_ACCT_YTD_BAL_SUM) AS PERCENTAGE,
(TARGET_BALANCE-NAT_ACCT_YTD_BAL_SUM) AS Diff
FROM STAGING_DATA;
"
Result:
Query2 Query2
code_combination | YTD_ACCT_BAL | NAT_ACCT_YTD_BAL_SUM | TARGET_BALANCE | PERCENTAGE | Diff |
---|---|---|---|---|---|
4150.30101.0000000000.00.4146.00000.0000.0000.000.0000.0000.000000 | -11700000 | -11700000 | 28935266.0026 | 1 | 40635266.0026 |
1000.31101.0000000000.00.0000.00000.0000.0000.000.0000.0000.000000 | -913750000 | -913750000 | -913750000 | 1 | -1.19209289550781E-07 |
the result in diff field in first row is correct however it not in second row. I have similar observation with other fields when the difference is 0. Can you please advise if I am missing some data type conversion or formatting?
Regards,
Bob