Skip to main content
Announcements
July 15, NEW Customer Portal: Initial launch will improve how you submit Support Cases. IMPORTANT DETAILS
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Loading tables twice to get two different counts?

Hello,
I have two tables - Parts and Main. I want to get a count(oid) - all orders as well as the count(oid) for orders with status = 'Complete'.
I need to create a bar chart to show the following calculation per month and year.
"count(oid) / count(oid) where status = 'Complete'"

i.e. Total # of orders divided by Total number of orders with status complete

Is there an easy way to do this? I tried the following way but this is resulting in a lot of synthetic keys.

Parts_Combo1 :
LOAD PNo,
PName, ptype;
SQL SELECT PNo,
PName, ptype from Parts;

LEFT JOIN
SQL SELECT oid,
PNo, Ship_date, status
from Main;

Parts_Combo2:
LOAD PNo,
PName, ptype;
SQL SELECT PNo,
PName, ptype from Parts;

LEFT JOIN SQL SELECT oid,
PNo, Ship_date, status
from Main where status = 'Complete';

Please help.

0 Replies