Beginning with code – an introduction to SAQL
This section will introduce you to coding in CRMA using SAQL.
Definitions
We'll now look at detailed definitions regarding what SAQL is and when it can be used.
What is SAQL?
SAQL is a runtime query language that enables ad hoc analysis of datasets. A SAQL script consists of a sequence of statements that are made up of keywords (such as filter, group, and order), identifiers (IDs), literals, or special characters. It is JavaScript Object Notation (JSON)-based and Apache Pig Latin (PIGQL)-familiar. A SAQL query loads an input dataset, operates on it, and outputs the results.
Here is a SAQL example:
q = load "My_Dataset"; q = group q by 'Division_Name'; q = foreach q generate 'Division_Name' as 'Division_Name', sum('Amount')/sum('Quantity') as 'sum_Amt/Qty'; q = order q by 'sum_Amt/Qty' desc;
What you see in the preceding...