Meliorainsights.com
  • Home
  • Tableau CRM
  • Field Notes
  • Non-Profits
  • Our Clients
  • About

Meliora Insights, LLC

​Data Cloud | CRM Analytics  (TCRM / Einstein Analytics) Consulting
​meliora - 'for the pursuit of the better'


A blog series distilling quantitative concepts /use-cases in CRM Analytics  (Einstein Analytics).

Picture

Using asString()  to create bindings & pass strings to a non-compact SAQL statement

3/3/2021

0 Comments

 
Picture
Picture




Step 1: Create a static query with columns that represent the strings you want to pass into the SAQL.In the example below we are passing three values labeled  "Value", "Value2", and "Value3".
Value 1 = 'CreatedDate_Year', 'CreatedDate_Month'
Value2 =  'CreatedDate_Year', 'CreatedDate_Month', "Y-M"
Value3 =   'CreatedDate_Year' + "~~~" + 'CreatedDate_Month' as 'CreatedDate_Year~~~CreatedDate_Month'




Create another entry for Year-Week combination.

Step 2: create the SAQL statement using the UI then <alt> E to alter the JSON. An example is
"query": "q = load \"zds_OpptyLineItem\";\nq = group q by ({{cell(static_1.selection,0,\"Value\").asString()}});\nq = foreach q generate {{cell(static_1.selection,0,\"Value\").asString()}}, sum('Annual_Revenue__c') as 'Annual_Revenue';\nq = fill q by (dateCols=({{cell(static_1.selection,0,\"Value2\").asString()}}));








0 Comments



Leave a Reply.

Site powered by Weebly. Managed by Hostwinds
  • Home
  • Tableau CRM
  • Field Notes
  • Non-Profits
  • Our Clients
  • About