mikeo'neil

Execute SQL Calculation with Turkey Toxicity

Discussion created by mikeo'neil on Nov 24, 2017
Latest reply on Nov 24, 2017 by user19752

FMA 16.03

I am creating a Chart using Execute SQL.

Fields used in this:

Constant        Number         = 1

Unit                Text                = various text (Engine 1, Ladder 3, Truck 4…)

Shift                Text                = A, B, C, D (work period of incident)

Type_Call      Text                = Cardiac Alert, Cardiac Arrest, Stroke Alert, Trauma Alert or Respiratory as types of calls.

Data Source: Delimited

 

I am trying to display total number of calls by unit for each of the types of calls/incidents. What’s displayed is totally inaccurate; only one record has Engine 1 as a unit. Each record (8) at this time for testing has a different unit.

 

I am sure that I am missing something simple?

 

X Axis:

ExecuteSQL ( "SELECT DISTINCT Unit FROM Pt_Outcome ORDER BY Unit "; "" ; "" )

 

Y Axis Series:

ExecuteSQL ( "SELECT COUNT (Constant) FROM Pt_Outcome WHERE Type_Call = 'Trauma Alert'  GROUP BY Unit" ; "" ; "" )

 

ExecuteSQL ( "SELECT COUNT (Constant) FROM Pt_Outcome WHERE Type_Call = 'Cardiac Alert'  GROUP BY Unit" ; "" ; "" )

 

ExecuteSQL ( "SELECT COUNT (Constant) FROM Pt_Outcome WHERE Type_Call = 'Stroke Alert'  GROUP BY Unit" ; "" ; "" )

 

ExecuteSQL ( "SELECT COUNT (Constant) FROM Pt_Outcome WHERE Type_Call = 'Cardiac Arrest’  GROUP BY Unit" ; "" ; "" )

 

ExecuteSQL ( "SELECT COUNT (Constant) FROM Pt_Outcome WHERE Type_Call = 'Respiratory'  GROUP BY Unit" ; "" ; "" )

 

 

 

Thanks-Mike

Outcomes