I currently have tried multiple ways (Execute SQL script, Table input, Database joins) to accomplish what I am trying to do. I need the sum and count respectively that my sql scripts below create to be put into a brand new field, or have these value be set as constants. I am trying to use each result in a calculator step later on in my transformation. Currently I have been trying to define fields using add constants and then played with the settings of the Execute SQL script (turning on or off variable substitution, putting the field name in the "Field to Contain Read stats"). But nothing has worked. If anyone knows of a good way to accomplish this it would greatly help!
Select sum(days_in_hospital) days_in_hospital_sum from hospital_days
where unique_stay_id in
(select unique_stay_id from hospital_days group by unique_stay_id having COUNT(unique_stay_id)=1);
SELECT COUNT(DISTINCT member_id) as "Total_Employees" from Hospital_days