Salesforce WAVE – Use of SAQL Tester

Blog by Stanley Sequeira | 07- Oct – 2015


sql-illustration

As developers one of the most important things to know on Salesforce WAVE is how to use SAQL Query Tester. The query tester essential takes simply PigQL or SAQL query and POSTS that query to Salesforce WAVE Platform. The query editor can be found here: SAQL Query Tester

9.1

Once you’re on this page, you’ll have to follow one of these steps –

  • Drag the link below onto your Bookmarks Toolbar
  • Right-click on it and select Bookmark This Location
  • Right-click on it and select Copy Link Location, then create a new bookmark and paste into the location

We’ll get into using this tool, but a little more prep work is needed before that.

Finding a SAQL Query in Google Chrome

Step 1: Open up Analytics Cloud on your Google Chrome Browser

9.2

Step 2: Now you need to open Developer Tools of Google Chrome. There are multiple ways of doing that

  • Click on More Tools à Developer Tools – OR –
  • Press Ctrl+Shift+I on your keyboard

9.3

Step 3:  You’ll see a split window, adjust the height so it doesn’t take up half of your screen

9.4

Step 4: Click on any previously created Lens. (If you’re new to creating lens – please visit this)

Step 5: You’ll see right away some text getting populated in the developer tools window

9.5

Step 6: Click on the ‘Network’ tab (Second tab placed next to the Elements tab)

9.6

Step 7: Click on Filter and lookup for the keyword Remote

9.7

Step 8: Click on the string which reads only Remote and navigate to the bottom of the page with the Label Request Payload. You’ll see a query Parameter.

9.8

Step 9: Copy this query and keep it aside. A Sample Query would like something like this –

q = load “0Fb61000000GnrkCAC/0Fc61000000HUHTCA4“; q = filter q by ‘Amount’ >= 2411036 && ‘Amount’ <= 4821392; q = group q by ‘StageName’; q = foreach q generate ‘StageName’ as ‘StageName’, count() as ‘count’; q = limit q 2000;”

P.S. This query will not work in your organization

 

If you see the ID – 0Fb61000000GnrkCAC/0Fc61000000HUHTCA4 it’s very specific to the Lens created previously. You can always retrieve this ID using the database JSON by simply replacing your URL

https://<Salesforce instance>/insights/web/lens.apexp

Putting SAQL Tester in use

Time to revisit the bookmark created earlier to put to test.

Step 1: Click on the bookmark

9.9

Step 2: You’ll see a section popping up at the top of the screen

9.10

Step 3: Now you can paste the query you retrieved from the developer tools and the results are shown in the Output window

9.11

You can modify the queries, change clauses and see how result set reacts to it. This could be a nice playground for developers to get hands on SAQL.


2 thoughts on “Salesforce WAVE – Use of SAQL Tester

Leave a comment