Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
hammermill21
Creator III
Creator III

Grouping Data in the script

Hello,

I have 3 separate groups of questions, and I want to group each set within the script. Can anyone help me with that?

As you can see below, [q1] through [q10] is one set, then [qs_1] through [qs_9] is another and then there is [qc_1] through [qc_12] :

 

[Eyewash Shower Annual Inspection]:
load * where [CREATED DATE]>='2019-01-01 00:00';
LOAD [ID] AS [ID],
// [PARENT_RECORD_ID] AS [PARENT_RECORD_ID],
// [PARENT_PAGE_ID] AS [PARENT_PAGE_ID],
// [PARENT_ELEMENT_ID] AS [PARENT_ELEMENT_ID],
[CREATED_DATE] AS [CREATED_DATE],
Date(Floor([CREATED_DATE], 1/(24 * 60)), 'YYYY-MM-DD hh:mm') AS [CREATED DATE],
[CREATED_BY] AS [CREATED_BY],
[CREATED_LOCATION] AS [CREATED_LOCATION],
[CREATED_DEVICE_ID] AS [CREATED_DEVICE_ID],
[MODIFIED_DATE] AS [MODIFIED_DATE],
[MODIFIED_BY] AS [MODIFIED_BY],
[MODIFIED_LOCATION] AS [MODIFIED_LOCATION],
[MODIFIED_DEVICE_ID] AS [MODIFIED_DEVICE_ID],
[SERVER_MODIFIED_DATE] AS [SERVER_MODIFIED_DATE],
[work_order_number] AS [work_order_number],
[is_there_a_barcode] AS [is_there_a_barcode],
[my_scan] AS [my_scan],
[equip_id_text] AS [equip_id_text],
[building] AS [Building],
[equipment_type] AS [Equipment Type],
[floor] AS [Floor],
[loc] AS [Location],
[enter_location] AS [Manual Entered Location],
[q1] AS [Clear access to the unit (no obstacles or obstructions) with no more than 10 seconds or 55 feet in distance and same level as the hazard with no more than one intervening door in the path of travel.],
[q2] AS [Signs are highly visible from all hazard areas in the work area and area around eyewash is well-lit.],
[q3] AS [Open valve to the full open position. The valve remains open without further use of the operators hands.],
[q4] AS [Flushing fluid patterned is dispersed at least 33 in. and not more than 53 in. from surface on which the user stands. The center of the spray shall be at least 6 in. from any obstruction.],
[q5] AS [Water flushed for 15 minutes or until clear. If potential of freezing is freeze-protection equipment installed and functioning appropriately.],
[q6] AS [Water temperature is tepid (60-100 degrees F).],
[q7] AS [With valve opened full open, that both eyes will be washed simultaneously at a velocity low enough be non-injurious to the user.],
[q8] AS [With valve fully opened position, measure the diameter of the spray patter. It is a minimum of 20 in. at 60 in. above the standing surface.],
[q9] AS [With flowmeter, the rate of flow is at least 0.4 gallons per minute. And covers the areas between the interior and exterior lines of the gauge at some point less than 8 in. above the eyewash nozzles.],
[q10] AS [Not dripping or leaking after valve is closed.],
[pictures] AS [pictures],
[comments] AS [Comments],
[getdate] AS [Date Inspected],
[technician_first_name] AS [Technician First Name],
[technician_last_name] AS [Technician Last Name],
[email_record] AS [email_record],
[select_equipment] AS [select_equipment],
[qs_1] AS [qs_1],
[qs_2] AS [qs_2],
[qs_3] AS [qs_3],
[qs_4] AS [qs_4],
[qs_5] AS [qs_5],
[qs_6] AS [qs_6],
[qs_7] AS [qs_7],
[qs_8] AS [qs_8],
[qs_9] AS [qs_9],
[qc_1] AS [qc_1],
[qc_2] AS [qc_2],
[qc_3] AS [qc_3],
[qc_4] AS [qc_4],
[qc_5] AS [qc_5],
[qc_6] AS [qc_6],
[qc_7] AS [qc_7],
[qc_8] AS [qc_8],
[qc_9] AS [qc_9],
[qc_10] AS [qc_10],
[qc_11] AS [qc_11],
[qc_12] AS [qc_12],
[qc_10a] AS [qc_10a],
[q_9a] AS [q_9a],
[qs_6a] AS [qs_6a],
[q6] AS [q6],
[q6a] AS [q6a],
[qs_8a] AS [qs_8a],
[qc_5a] AS [qc_5a],
[area_equipment_is_located] AS [area_equipment_is_located],
[enter_equipment_type] AS [enter_equipment_type],
[enter_floor] AS [enter_floor],
[overall_eyewash_pass_fail] AS [overall_eyewash_pass_fail],
[overall_shower_pass_fail] AS [overall_shower_pass_fail],
[overall_combination_pass_fail_61] AS [overall_combination_pass_fail_61],
[area_equipment_is_located_other] AS [area_equipment_is_located_other],
[enter_barcode_number] AS [enter_barcode_number],
[enter_building] AS [enter_building],
[recomment_replacement] AS [recomment_replacement],
[__FK_record] AS [__KEY_root]
RESIDENT RestConnectorMasterTable
WHERE NOT IsNull([__FK_record]);


[coordinate]:
LOAD [@Value] AS [@Value],
[__FK_coordinate] AS [__KEY_location]
RESIDENT RestConnectorMasterTable
WHERE NOT IsNull([__FK_coordinate]);


[location]:
LOAD [type] AS [type],
[__KEY_location] AS [__KEY_location],
[__FK_location] AS [__KEY_root]
RESIDENT RestConnectorMasterTable
WHERE NOT IsNull([__FK_location]);


[root]:
LOAD [__KEY_root] AS [__KEY_root]
RESIDENT RestConnectorMasterTable
WHERE NOT IsNull([__KEY_root]);


DROP TABLE RestConnectorMasterTable;

 

Thank you!

Labels (1)
1 Reply
jheasley
Luminary Alumni
Luminary Alumni

the best solution is scalable from this theory below:

Load
field1,
field2,
field3,
field4,
[q1]&'|'&[q2]&'|'&[q3]&'|'&[q4] as QuestionGroup1
From [mysource];

i used a pipe for the delimiter, bu you can obviously use anything.