Questions tagged [saql]

SAQL - Salesforce Analytical Query Language

Filter by
Sorted by
Tagged with
4
votes
2answers
2k views

How to query all rows in a dataset using SAQL

We have a dataset with millions of rows in Salesforce Wave. We want to fetch records using SAQL. We used the below SAQL to get the records. And we executed this SAQL using "services/data/v34.0/wave/...
4
votes
1answer
91 views

After modifying dashboard SAQL in template downstream apps fail to create

What we have done: Created a trivial Einstein Analytics app with the most simple dataflow and dashboard. Created a template for this app Successfully created a (downstream) app from this template (to ...
3
votes
1answer
1k views

How to find percentage using a single dataset

I am working on SAQL to find Percentage of Leads that has been converted into opportunities. I am working on wave-utils to check my SAQL and I am receiving the following error: Cogroup projection ...
2
votes
3answers
292 views

Dealing with Daylight Savings Time in Einstein

I'm in the UK and having issues importing dates into Einstein due to them being in UTC format while we're currently in UTC+1 due to Daylight Savings Time. I know I need to add some compute nodes to my ...
2
votes
1answer
221 views

Faceting Not Working Within Dataset - Einstein Analytics

I am editing a dashboard in Einstein Analytics. It contained 5 charts, all from the same datasource, and they all faceted between one another when selections were made. I was asked to change the top ...
2
votes
1answer
517 views

Wave REST API returns BAD REQUEST ERROR 400

public class SendWaveUsingRESTAPI { private final String clientId = 'xxxx'; private final String clientSecret = 'xxx'; private final String username = 'xxxxx'; private final String password = '...
2
votes
0answers
42 views

Is it possible to save/persist data from an Einstein Dataset back to Salesforce?

We are building a Lightning application that will be used to show Einstein consolidated data to users. We want to either consume this data directly from Einstein (we know we can do that with Wave SDK ...
2
votes
2answers
219 views

Can complex (Variance) analysis be done in Einstein Analytics?

Background Every month we copy revenue data in our from their original objects (complex normalized tree of related objects) into something we call a snapshot. A denormalized flat table (Custom object)...
2
votes
1answer
147 views

Assign bindings to variables

I'm working on a Einstein Analytics project, and I'm trying to get some bindings to be assigned to variables. "q = load \"Dataset\"; _value = foreach q generate ({{cell(S_Amount__1_USD.result, 0, \"...
2
votes
0answers
138 views

Performance issue when offset used in SAQL

I am using the endpoint data/v35.0/wave/query to execute a SAQL query. When I execute the below SAQL which does not contain offset, I am getting the response approzimately in 1 secs load \"xxxx/xxxx\...
1
vote
1answer
1k views

SAQL vs SOQL vs SOSL vs SQL? [closed]

I have recently come across SAQL and I'd like to understand the differences between all the different ways to query against Salesforce APIs. The new einstein branding is too complex to get my head ...
1
vote
1answer
6k views

Wave Analytics - mixing two datasets

Could Wave Analytics handle the following scenario? I need to get all the Contracts and Accounts (some filtering here) Get all the Cases pointing to Accounts List all the Accounts with cases pointing ...
1
vote
1answer
778 views

Date format in SAQL

I have a requirement in Wave Analytics where I need to fetch records from Previous year when current year is completed. I have a field named Processing Year. It now fetches 2017 records which we have ...
1
vote
1answer
1k views

Sample dataset and Sample dashboard that uses SAQL

I am trying to use SAQL for my dashboar. But when I specify filter or group in SAQL, the dataset fails to load the bar charts. Below is my step I am using "steps": { "...
1
vote
1answer
401 views

SAQL: How to group by string field on whether it is NULL or NOT NULL

As mentioned in the subject I need to group a string field's data by whether its empty or not empty. How can I do this with SAQL? Do I need to create a boolean variable? and group by that?
1
vote
1answer
334 views

SAQL sort without including field in the return results

I need to sort by a field in a SAQL query, but I do not want that field to appear in my results. For example, I am trying to do this q = load "xxx"; q = foreach q generate 'account_id' as '...
1
vote
2answers
2k views

Using variables in SAQL

I'm trying to basically work with SAQL using some sort of variable. Not sure why every time I do that, I receive an error that the Identifier can't be found. So, let's suppose I want to divide the ...
1
vote
1answer
3k views

In Wave/Einstein analytics, is it possible to combine query results from 2 different datasets into the same visualization?

I am creating charts/tables on a Wave Dashboard using a small number of datasets that I've created using dataflows and recipes. What I want to do now is to query (i.e., somehow get data) from two of ...
1
vote
1answer
940 views

Analytics Wave - Order by Case Statement

Is it possible to Order a SAQL query using a case statement? We changed CloseDate_Month in to text so it displays as month name instead of month number, but when that's used in the order by, it order ...
1
vote
2answers
874 views

How to do a simple math on aggregate values from different streams in SAQL?

This should be some basic stuff but lack of good documentation on SAQL is making it hard to figure out. I just want to do a simple math like ths- Avg. Sale Price = Total Sale Price/Qty The filters ...
1
vote
0answers
19 views

Is it possible to group by a unique field but display a non-unique one with SAQL?

I'm a SAQL beginner and I'm currently trying to modify an errant dashboard in Einstein Analytics that I did not create. The dashboard contains a step that currently groups by Account Name and sums the ...
1
vote
0answers
36 views

calculate time difference between status changes for Order History

Scenario We keep orders information into Salesforce and we have our own statuses too, whenever the order status changes in our Ecom system it updates that into Salesforce. I can get the timings via ...
1
vote
1answer
82 views

SAQL calculate average case close rate for einstein

Scenario So I want to display average case closing rate(for now in minute) on dashboard. What I've done So if I'm not wrong I can calculate the difference time like (closed date - created date) ...
1
vote
0answers
35 views

Global variable using SAQL

Can global variables be used with SAQL? How can I see the value of the global variables in Wave Analytics?
1
vote
0answers
71 views

SAQL Date format conversion

I am pulling in a date field from a secondary (Japan) SFDC org into our native org. The format in the Japan org shows it as just a date (yyyy-MM-dd) but when I look at the date in the data connection ...
1
vote
1answer
316 views

Salesforce Analytics Dataflow - Aggregating datasets?

Assume I have a dataset like such: Cart Data ---------- oId cId iId $$ 1 C1 . 2 1 C1 . 3 1 C2 . 3 2 C1 . 1 3 C2 . 3 3 C3 . 4 4 c4 . 5 4 c4 . 5 5 c2 . 4 6 ...
1
vote
0answers
254 views

Einstein Analytics Binding statement for Year to Date where date is listselector

I have a list selection for Production Date (Year--Month for ease of selection). I have a number that is the credits that should be filtered year to date based on the selected Production Date. I ...
1
vote
0answers
36 views

SAQL - Unnest Array to Rows [closed]

Is there a way using SAQL to unnest an array into multiple rows? For example, my output is ['abc', 'def', ghi'] and I would like to end up with 'abc' 'def' 'ghi'
1
vote
1answer
463 views

SAQL - When I dynamically create dates in SAQL and group them, I can't use the “Timeline” chart

I try to create a timeline chart for every year for products on the market that are started to sell before that year and ended to sell after that year. To get my filtered data I filter them like I ...
1
vote
2answers
2k views

SAQL Using Current year and doing calculations with dates in a Formula Condition

I want to do calculations with dates and use 'current year' in a formula condition. When I tried to manipulate dates in a formula I always receive an error of incompatibles types; NUMBER AND DATE. ...
1
vote
1answer
620 views

Change Time Zone in Wave Dashboard

I am using page 28 of this doc for reference: https://resources.docs.salesforce.com/200/latest/en-us/sfdc/pdf/bi_dev_guide_saql.pdf I need to change the time zone in the step. I am trying to use the ...
1
vote
0answers
94 views

Wave - Using Times as a Group

I am attempting to build a dashboard using times in the format hh:mm:ss AM/PM. I have tried to do this several different ways include adding a date to the time (even though I don't need that because ...
1
vote
0answers
163 views

Analytics - Multiple List Widgets and Raw Data Tables - how to filter on both?

I have a dashboard with two list widgets (Account and Opportunity) and two raw data tables (Opportunity Detail and Order Detail). I have used SAQL to group data and then populate the first table (...
0
votes
2answers
375 views

How to convert decimal to percentage in saql?

How to convert decimal to percentage in saql?
0
votes
2answers
2k views

SFMC query syntax

Greeting All, New to the SFMC application and have been assigned as the new admin. In some of the queries I am having difficulty understanding the purpose of the syntax and I am hoping someone here ...
0
votes
1answer
97 views

preconfigure filter affecting widget with disabled apply global filters

I have embedded a wave dashboard on a visualforce page. In my dashboard I have charts that "Apply global filters is disabled". What happen is when I view the dashboard on the visual force page, and ...
0
votes
1answer
810 views

How to check “does not contain” in saql?

I have written my saql like q = load "Opportunities"; q = filter q by !('Opportunity.Name' in ["test","TEST ","Test"]); q = group q by 'Opportunity.Name'; q = foreach q generate 'Opportunity.Name' ...
0
votes
2answers
728 views

It is possible to make a sum under some criteria Wave Analytics

I'm stuck with a problem and I want to make a sum only under certain criteria, for example: Add the Total field per month and then take the average of the last 3 months ie sum (total) -> if month = ...
0
votes
2answers
1k views

how to create a bucket field, percentage in wave

Currently I have a dataset that is all opportunities. I generated a dashboard and in there I have report/graph that is all the opportunities grouped by a field called channel__c In salesforce I ...
0
votes
0answers
6 views

In Einstein Analytics Dataflow, how to calculate second and last entry of a partition (compute relative)

I have a list of Orders. I need to calculate the most recent, the second most recent and the oldest Order for each Account. In Einstein Analytics I use the field "Compute Relative": According to my ...
0
votes
0answers
40 views

Generate previous work day

I want to display sales from yesterday but the company is close Saturday and Sunday. So when the day is Monday I need to return Friday sales. But if the day is Tuesday I can return Monday sales. Is ...
0
votes
0answers
36 views

Formatting a derived measure that was calculated from multiple datasets

I understand how to format a derived measure using the XMD. But here, my derived measure comes from multiple datasets. Here is my SAQL: q = load "Dataset1"; q = group q by all; q = foreach q ...
0
votes
0answers
23 views

Salesforce Einstein Dataflow Join

In the dataflow, Is it possible to merge two tables based on the same key in which one table has multiple values? (See attached image) Site Code is the key between the two tables.
0
votes
1answer
52 views

saql create bar segments

I would like to create stacked bar based on something a saql query like this: q = load "datasetname"; q = filter q by 'field1' == "false" and 'field2'=="homescreen"; q = filter q by date('...
0
votes
0answers
16 views

Einstein Analytic - Display active filter in text widget

For a project I need to implement an active filter display for an analytic dashboard. If I'm working on Opportunity dataset and the user filter by CloseDate_Month = 01 (january) and then select the ...
0
votes
0answers
46 views

How to display values for two picked dates in Analytics (SAQL)

I have to let the user pick two dates and view a number of events for these dates. I can easily make it for a fixed time interval, like this: q = load "dataset"; q_A = filter q by date('date_Year', ...
0
votes
0answers
59 views

Einstein Analytics - Limit dashboard results to only subset of dataset from the most recent day

I am creating a dashboard to display the most recent day's worth of data. I have a sfdcDigest localized copy of a SFDC object that includes over a year's worth of records. I have a dataflow to create ...
0
votes
0answers
31 views

cant Understand values inside SAQL Query?

I have a dashboard which was built using a template in one of its components. It was showing some wrong values. When I Explored it, I found this in SAQL query: q = load "Account_Revenue5"; q = ...
0
votes
0answers
24 views

SAQL statement fill does not support Week in dateCols

Analytics SAQL Reference says it supports the week for dateCols in fill statement of SAQL, however it does not support weekfield. Salesforce doc https://developer.salesforce.com/docs/atlas.en-us....
0
votes
1answer
146 views

Analytics Facet issue - Syntax Error after token ) :: ilter q by (());

I have a SAQL step in my dashboard that goes something like this: q = load "aDataset"; q = filter q by 'A__c' == "true" && !('B__c' >= "-"); q = filter q by 'Type__c' != "Organization"; ...