Calculations within PFI

 4 Replies
 0 Subscribed to this topic
 52 Subscribed to this forum
Sort:
Author
Messages
Bob
Basic Member Send Private Message
Posts: 7
Basic Member
I am attempting to use PFI to simulate generation of reports.  The query that PFI accepts is:
SELECT UCCUNO, UCORNO, UCIVQT, UCCUAM
FROM *LIBL.OSBSTD
WHERE UCORTP IN ('CUS','EMC') AND UCIVDT BETWEEN 20100201 AND 20100228. 

However, the actual SQL statement I want to apply to PFI is:
SELECT UCCUNO, UCORNO, SUM(UCIVQT), SUM(UCCUAM)
FROM *LIBL.OSBSTD
WHERE UCORTP IN ('CUS','EMC') AND UCIVDT BETWEEN 20100201 AND 20100228
GROUP BY UCCUNO, UCORNO

How can this be accomplished within PFI?

Thanks

George Graham
Veteran Member Send Private Message
Posts: 201
Veteran Member
Are you getting an error?
Bob
Basic Member Send Private Message
Posts: 7
Basic Member
HI George:
    I did not receive any error during the genration of PFI, but the return value of both summed data field are "undefined".  Is there any way to fix this issue?  This issue is the only thing preventing this PFI being published.

Thanks
Bob
John Henley
Send Private Message
Posts: 3351
Use an alias in the SQL for the sum columns, e.g. SUM(UCCUAM) AS UCCUAM_SUMMARY.
Then reference nodename_UCCUAM_SUMMARY in your flow.
Thanks for using the LawsonGuru.com forums!
John
Bob
Basic Member Send Private Message
Posts: 7
Basic Member
It work! Thank you so much...