As of December 1, 2020, Focal Point is retired and repurposed as a reference repository. We value the wealth of knowledge that's been shared here over the years. You'll continue to have access to this treasure trove of knowledge, for search purposes only.
New TIBCO Community Coming Soon
In early summer, TIBCO plans to launch a new community—with a new user experience, enhanced search, and expanded capabilities for member engagement with answers and discussions! In advance of that, the current myibi community will be retired on April 30. We will continue to provide updates here on both the retirement of myibi and the new community launch.
What You Need to Know about Our New Community
We value the wealth of knowledge and engagement shared by community members and hope the new community will continue cultivating networking, knowledge sharing, and discussion.
During the transition period, from April 20th until the new community is launched this summer, myibi users should access the TIBCO WebFOCUS page to engage.
Does anyone know why SALES=0.00 and SALES1=336.00 as in the code shown below? We only have one row in the table for IDINVN='128464449'.
IDAMCF | IDNSVA | RTRAMT
1 336.0000 .0000
DEFINE FILE SALES_VP
SALES/D20.2 = (IDAMCF * IDNSVA) + RTRAMT;
END
TABLE FILE SALES_VP
SUM SALES
COMPUTE SALES1 = (IDAMCF * IDNSVA) + RTRAMT;
BY IDINVN
WHERE IDINVN EQ '128464449'
END
===============================
Below is the trace of sql:
SELECT
T1."IDINVN",
SUM(((T1."IDAMCF" * T1."IDNSVA") + T1."RTRAMT")),
SUM(T1."IDAMCF"),
SUM(T1."IDNSVA"),
SUM(T1."RTRAMT")
FROM
EDADBA.sales_vp T1
WHERE
(T1."IDINVN" = 148024752)
GROUP BY
T1."IDINVN"
ORDER BY
T1."IDINVN";
This message has been edited. Last edited by: Pku,
Both SALES and SALES1 yielded the same number 336.00 when I changed the SUM to PRINT. I might be wrong, both SALES and SALES1 should get the same number regardless aggregation since there is only one row.
What is the field format of fields IDAMCF, IDNSAV and RTRAMT ?
Since you have not assigned any format to SALES1 in your COMPUTE a format is assigned automatically and maybe the one from the DEFINE gives an invalid result and just return 0
WF versions : Prod 8.2.04M gen 33, Dev 8.2.04M gen 33, OS : Windows, DB : MSSQL, Outputs : HTML, Excel, PDF In Focus since 2007
Posts: 2410 | Location: Montreal Area, Qc, CA | Registered: September 25, 2013
You're right. Redefine the field seems correcting the problem.
DEFINE FILE SALES_VP
N_RTRAMT/D20.2 MISSING ON = IF RTRAMT IS MISSING THEN 0 ELSE RTRAMT;
SALES/D20.2 = (IDAMCF * IDNSVA) + N_RTRAMT;
END
TABLE FILE SALES_VP
SUM
SALES
COMPUTE SALES1/D20.2 = (IDAMCF * IDNSVA) + RTRAMT;
BY IDINVN
WHERE IDINVN EQ '128464449'
END
This message has been edited. Last edited by: Pku,