QUERY examples - j5 - 28.0 - Administration & Configuration - Hexagon

j5 IndustraForm Designer Reference

Language
English
Product
j5
Search by Category
Administration & Configuration
j5 Version
2019

It is important to understand the following:

  • IMPORT functions are evaluated server-side and the results are sent back to the client.

  • QUERY functions are evaluated client-side only.

Example one:

The formula below uses the IMPORT.MYSUBLOG function (server-side) to retrieve information from the general_logbook, and then it orders the results by using the QUERY function (client-side):

=QUERY(

"SELECT start_time, message, created_by, area1, logtype, logtype2, last_modification, modified_by FROM ? ORDER BY logtype2",

FILTER(IMPORT.MYSUBLOG(

"general_logbook",

"start_time, message, created_by, area1, logtype, logtype2, last_modification, modified_by"),

"logtype=?", "General"))

Example two:

The formula below adds a summary bar chart that displays Shift Task repeating section information. The

IMPORT.LOGREPEAT function (server-side) retrieves information from the repeating section, and then the QUERY function groups the data by TaskStatus so that the BARCHART function can display a count of entries per status.

=BARCHART(QUERY(

"SELECT TaskStatus as Status, COUNT(TaskStatus) as [Num Tasks] FROM ? GROUP BY TaskStatus",

FILTER(IMPORT.LOGREPEAT("handover_logbook", "TaskStatus"),

"status=?",

"Open for Approval")))