Questions tagged [saql]

SAQL - Salesforce Analytical Query Language

Filter by
Sorted by
Tagged with
0
votes
0answers
4 views

Create Dataset of Account with or without contacts in Einstein

I have created a dataflow where I pull accounts and contacts and apply a augment such that Contact having left source with Key Account.Id while Account having right source with Key Id. Now I am able ...
0
votes
0answers
9 views

Row Formulas in Einstein Analytics

I am being asked to create an excel style table which I'm capable of doing normally... But I don't know how to create anything similar in EA/TCRM. What they are asking for is Current Weeks $'s Last ...
0
votes
0answers
7 views

Divide by non grouped field in a grouped query

I am trying to create a line graph that shows the breakdown of insights created broken down by week and grade per FTE. The FTE is held in a separate dataset and whenever I can't us the same cogroup as ...
0
votes
0answers
12 views

SAQL - Why is “limit” not applied to ungrouped aggregation?

I have a very basic chart component with the following SAQL: q = load "AllOpps"; q = group q by all; q = foreach q generate sum('Amount') as 'sum_Amount'; q = order q by 'sum_Amount' desc; q ...
1
vote
0answers
30 views

SAQL computeExpression with date_diff() or daysBetween() and values that may be null

I have a dataflow with a computeExpression step where I want to define the number of days between two datetime fields. The SAQL expression below executes correctly, however in instances where my ...
0
votes
0answers
126 views

Total grouped by columns and rows Einstein Analytics Pivot Table

I have a pivot table with three fields on Opportunity table. Account Industry, Opportunity Stage and Amount. Now I need to group the Amount i.e. show the total amount based on Industry as well as ...
0
votes
0answers
60 views

Einstein Analytics - SAQL - Compute expression in Dataflow - Convert date field to Quarter Year (“ie Q1 YYYY”)

I am trying to create a new column that is able to take a date field and essentially turn it into a text string that indicates the quarter and year based on the date being pulled (i.e., if the month ...
0
votes
1answer
67 views

Tableau CRM: How to add dynamic “date” via computeExpression?

in my dataflow I have a computeExpression that should add a "Date" field. That date field should always contain the first of the current month (e.g. for right now: Feb. 1st 2021). I've tried ...
0
votes
1answer
149 views

How to calculate date difference using two separate data rows?

I'm using the LiveChatTranscriptEvent object to try and determine the time difference between the events ChatRequest and TransferredToQueue. Each Type is a different row on the object so it would ...
0
votes
1answer
291 views

How to join/cogroup by multiple fields in SAQL?

I am new to SAQL and am trying to join two datasets (let's call them q and r) using cogroup. I have 4 columns in each table (let's call these A, B, C and D). Columns A - C are the same in both ...
0
votes
0answers
222 views

Einstein Analytics Data Preparation CSV symbols error

in my prep for the SF Einstein certification I've been working on the "Einstein Analytics Data Preparation Specialist" super badge. I'm on step 3 and I'm getting the following error: I've ...
0
votes
2answers
89 views

In SAQL, what's the equivalent of the SQL keyword “HAVING”?

The SQL keyword HAVING is used like a WHERE clause except that HAVING works on aggregated groups. Is there a way to do this in SAQL? Gracias.
1
vote
0answers
51 views

Help needed with SAQL fill()

I need your help with the fill() SAQL function. I have created the query below and it runs, but the fill() doesn't work (no zeros get inserted). Please let me know what I am doing wrong here. Thank ...
0
votes
0answers
14 views

Weekly Per FTE calculation only shows 1 bar in Chart, SAQL

I am trying to calculate the number of logs per FTE per week to show in a graph with a bar for each week. The logs and the FTE are in 2 separate datasets so I am using cogroup to bring them together. ...
1
vote
0answers
27 views

SAQL: How to count yes/no responses to chatbot question

I've been using Salesforce for less than two months and EA less than one. Requirement: I need to create a report that answers the question, "What is the client feedback on the chatbot?" Data:...
0
votes
0answers
36 views

Convert a Formula in Report to a column in an Analytics Dataset

I'm very new to Analytics Studio and could use some guidance. I have this Dataflow so far The goal is to add a column to Ryan_Test dataset here that replicates functionality we have in a Report (see ...
0
votes
1answer
32 views

Dynamic SAQL Wave Analytics

I'm trying to use IN operator in my SAQL dynamically while doing callout using rest API. If I'm trying to use hardcoded in operator it’s working. Working: q = filter q by 'Category' in ["...
0
votes
1answer
108 views

Using SAQL to place total at bottom of results instead of alphabetically ordered

I have a SAQL Query which takes a list and attempts to display a total row at the bottom. However, the way that my code is written is causing the Total column to be alphabetically rearranged so that ...
0
votes
0answers
17 views

SAQL formula not calculating

We are building a dashboard and once of the metrics we are trying to try is the time it takes our sales rep to call a lead. I am doing the calculation of a lead status history tracking field. I am ...
0
votes
1answer
466 views

How to include a row with subtotals by second level group in Einstein Analytics using SAQL?

I would like to add a subtotal row at the bottom of a compare table in an Einstein Analytics dashboard. The table is made up of sums of measures grouped by two dimensions. The subtotals needed are ...
0
votes
1answer
120 views

Get derived date dimension year or month

I'm creating a derived date dimension in SAQL and wanted to find out if there was any way to get the year or month (or day or quarter) parts from it? Normally, adding an "_year" to the end ...
0
votes
0answers
206 views

SAQL query from Apex

I'm trying to get some records from Einstein Analytics in my developer console. public class SuperClass { public String action; public String responseId; public Results ...
0
votes
1answer
287 views

Filter records not in other query results - SAQL

I am starting to work with einstein analytics and SAQL and I already searched on internet before posting this question but I couldn't find an answer to my problem. I need help to know how can I ...
0
votes
1answer
134 views

OR Condition in JSON filter Wave analytics Dashboard

I have a json filter in lightning record page for a Analytics dashboard. There are conditions where Code1__c will be NULL or Code2__c will be NULL . Is there any mechanism in JSON filter where we can ...
0
votes
1answer
267 views

multiply two fields in group by SAQL

I have this below SAQL. What i want in end result is sum(q_A.'Revenue' * q_A.'Opportunity.Probability')/100) for each month basically Revenue is OpportunityLineSchedule field and Probability is ...
0
votes
1answer
196 views

Monday Morning Challenge: Join two data streams with SAQL in Salesforce Einstein Analytics

I do have two data streams q1 and q2. I want to merge q2.SUM into q1 if they both have the same value in MaxMon. It looks so obvious, but I am lost in between all this cogroup and union magic. This ...
0
votes
1answer
181 views

Need to get the most recent CaseHistory record for the particular date(Created Date) in the einstein analytics

I have the table like this:- CaseNumber CaseHistory Created Date 005 oo1 09/02/2020 002 10/02/2020 006 003 ...
1
vote
1answer
142 views

Multiple SAQL queries in Apex cause You have uncommitted work pending

I am trying to use SAQL queries in Apex and trying to execute following logic in my developer console. It gives me uncommitted work pending error which we basically get during a DML before a callout. ...
0
votes
1answer
924 views

Is there a way to perform an inner query in SAQL/einstein anaylitics

I need to query all activities for each account that I have an activity on. I am using the activities dataset from the activity capture. In SQL it would be SELECT activityid, account.name, account....
0
votes
1answer
596 views

ComputeRelative sum in EinsteinAnalytics

In a ComputeRelative node I try to sum up the values of a grouping. I tried to use sum('parameter'), but it gives me the error Something went wrong while executing the computeRelative xxx node: ...
0
votes
1answer
87 views

Show derived measure in aggregate bar chart

I want to show a bar chart with list of opportunities and total days it took to close the opportunity. I tried the below query q = load "DTC_Opportunity_SAMPLE"; q = foreach q generate '...
0
votes
1answer
1k views

Convert date into string in Einstein Analytics Dataflow

I tried to convert order created date in the format of yyyy-MM-dd'T'HH:mm:ss.SSSS'Z' into a string using the following SAQL command. date_to_string(CreatedDate,"yyyy-MM-dd'T'HH:mm:ss.SSS'Z'") which ...
0
votes
1answer
2k views

How to bucket field values in Einstein analytics

I have a dataset with a field as Order Country. It has field values as 'AUS', 'USA', 'GBR', 'IND', 'KEN', etc. Now, is there any way to bucket these values as bucket 1: 'AUS', 'USA', 'GBR' - Total ...
1
vote
1answer
930 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 ...
0
votes
1answer
62 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 ...
1
vote
1answer
263 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
1answer
196 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('...
1
vote
0answers
301 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
653 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
90 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
304 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 ...
2
votes
0answers
62 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 ...
0
votes
1answer
977 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 '...
0
votes
2answers
472 views

Replace null values in JSON

I'm using a compare table and some values in my datasets doesn't exists. So when I'm trying to calculate the percentage between two rows I got no values. For example I got this image : In the forst ...
0
votes
1answer
410 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
274 views

Bind the Result of one dataset to an another

I have two steps. One with my Holidays group by years and month created with a single dataset with one column "Holidays" with all date of holidays in 2018 and 2019. The second one is my Amount per ...
0
votes
1answer
670 views

Filter Dataset with only Work Days

I would like to get the days from Monday to Friday (except holidays) in my SAQL queries. For now I only have Opportunity dataset with Amount and all rows related to CloseDate (Date, Year, Month, Day, ...
1
vote
1answer
1k 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 ...
0
votes
1answer
36 views

Get number of CloseDate_Day in a group of CloseDate_Month

I want to get the sum of Amount of the company per month (CloseDate_Month) and divide this sum by the number of CloseDate_Day in this month. q = load "Test"; q = group q by 'CloseDate_Month'; q = ...
0
votes
0answers
1k views

Einstein Analytics - SAQL - Compute expression in Dataflow - Period over Period formula

I have a formula field I need to create in Data flow using a Compute expression. It needs to group by our 'Record_ID' and compare this weeks data to last weeks. The data i want to compare is labeled ...