Questions tagged [saql]

SAQL - Salesforce Analytical Query Language

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

SAQL Query in CRM Analytics

I'm trying to filter the Case object on 'ClosedDate'. For instance, I want to get all the Cases that were closed yesterday. My current query uses relative string literals as such: q = load "...
dannyc12's user avatar
0 votes
0 answers
90 views

Window Calculations in SAQL

I'm new to SAQL. I'm seeing a reference example where they are calculating three months ago: sum(sum(A)) over ([-3..-3] partition by Manager_Name order by ('DATA_DT_Year', 'DATA_DT_Month')) as '...
Venkata's user avatar
0 votes
0 answers
40 views

Sum of LOV where we have duplicate records

I need some help, I am trying to create a lens to give me a sum of LOV. My data set has duplicated rows because of multiple campaigns attached so the sum is giving me an inflated number. is there a ...
Mondo Burger's user avatar
0 votes
0 answers
210 views

How do i process results from ConnectApi.Wave.executeQuery

Folks, I have the following code where i want to read some data from analytics dataset. String query = 'q = load "0Fb3i000000DMtlCAG/0Fc59000000pxp5CAA"; q = filter q by \'acct_id_txt\' in [&...
SavvyGoat's user avatar
  • 105
0 votes
1 answer
739 views

Can I use coalesce with a binding expression in a variable in a custom SAQL query?

I'm writing a custom SAQL query with bindings in order to total some categories that are made in a list elsewhere on the dashboard. Here's my query so far; it has the same binding expression multiple ...
Mike's user avatar
  • 744
0 votes
0 answers
593 views

Customize list filter

I have a list filter in dashboard there I have around 50 values. Now out of 50 there are five values which ‘Japan 20’, ‘Japan20’, ‘Japan2020’, ‘Japan-20’, ‘Japan_20’. Now in list filter I want to ...
manish's user avatar
  • 109
0 votes
1 answer
534 views

Getting the Error Code: 6'101 when using Connected Objects for my TCRM Recipe

I am testing a recipe that accesses the data from "connected objects" instead of a data set, selected only necessary columns. I performed sync of objects a few hours before. Getting the ...
user113460's user avatar
0 votes
1 answer
245 views

I want to add Sub Total using SAQL Query

Region Sector Notes Count of Rows America FI Client Choice 2 Entry 8 **Sub Total 10** MI Rotation 45 Data Source 30 **Sub Total 75** **Sub Total 85** I have the above table which shows Sub ...
Darshika Verma's user avatar
0 votes
1 answer
649 views

sfdx-mohanc-plugins error

I'm getting Error: yarn add sfdx-mohanc-plugins@latest --non-interactive --mutex=file:C:\Users\User-S\AppData\Local\sfdx\yarn.lock --preferred-cache-folder=C:\Users\User-S\AppData\Local\sfdx\yarn --...
Sam swarup 's user avatar
1 vote
0 answers
277 views

How can I use a global dashboard filter in a SAQL Query?

If I have a global filter on a dashboard (e.g. Account_Name), is it possible to reference that filter in a SAQL query something like: q = load "My_data_recipe"; q = filter q by 'Account_name'...
Tepinvic's user avatar
1 vote
0 answers
69 views

Editing messy SAQL - adding bindings

I have an interesting challenge on my hands. The solution I'm implementing required editing the SAQL in order to implement some subtotaling that isn't supported by the WYSIWYG... Having done that, I ...
upJumpDaBoogie's user avatar
1 vote
0 answers
370 views

How to Hide Part of the X-Axis (Time Axis) in Bar Chart Tableau CRM?

I have a question about X-Axis in charts in Tableau CRM (Einstein Analytics). I created a Time Combo chart with 3 calculations through a time line from 2019 to 2021. Amount the three calculations: the ...
Startistin's user avatar
1 vote
0 answers
679 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 ...
nbrown's user avatar
  • 4,013
0 votes
1 answer
1k 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 ...
Christoph's user avatar
  • 1,022
0 votes
1 answer
684 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 ...
MyNameHere's user avatar
0 votes
1 answer
2k 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 ...
JC2020sg's user avatar
0 votes
2 answers
499 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.
Allen's user avatar
  • 1
1 vote
0 answers
318 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 ...
Peter's user avatar
  • 11
1 vote
0 answers
100 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:...
MyNameHere's user avatar
0 votes
1 answer
127 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 ["...
salesforce Developer's user avatar
0 votes
1 answer
1k 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 ...
Scott B's user avatar
  • 27
0 votes
1 answer
1k 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 ...
DavidC's user avatar
  • 1
0 votes
1 answer
1k 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 ...
Instread's user avatar
  • 633
0 votes
1 answer
1k 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 ...
Rui Mendes's user avatar
0 votes
1 answer
389 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 ...
sfdc_to_learn's user avatar
0 votes
1 answer
900 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 ...
sfdc_to_learn's user avatar
0 votes
1 answer
814 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 ...
Mario Z's user avatar
  • 13
0 votes
1 answer
882 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 ...
Sushant Arora's user avatar
1 vote
1 answer
351 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. ...
Shiva Achukatla's user avatar
0 votes
1 answer
2k 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....
SomeSalesforceDev's user avatar
0 votes
1 answer
913 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: ...
Andrea Voggenreiter's user avatar
0 votes
1 answer
346 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 '...
S.Sujendran's user avatar
0 votes
2 answers
3k 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 ...
Skumar's user avatar
  • 151
1 vote
1 answer
2k 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 ...
Alex Poole's user avatar
0 votes
1 answer
91 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 ...
Jack's user avatar
  • 93
1 vote
1 answer
583 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 ...
Formatting_SAQL's user avatar
0 votes
1 answer
361 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('...
user10765213's user avatar
1 vote
0 answers
597 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 ...
Indrajeet Latthe's user avatar
1 vote
1 answer
962 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) ...
Indrajeet Latthe's user avatar
1 vote
0 answers
177 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?
user69421's user avatar
2 votes
1 answer
1k 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 ...
neil curry's user avatar
2 votes
0 answers
81 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 ...
Sergio's user avatar
  • 163
1 vote
1 answer
2k 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 '...
smukov's user avatar
  • 5,553
0 votes
2 answers
708 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 ...
Jack's user avatar
  • 93
0 votes
1 answer
939 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 ...
hpmacugay's user avatar
0 votes
1 answer
418 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 ...
Jack's user avatar
  • 93
0 votes
1 answer
1k 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, ...
Jack's user avatar
  • 93
1 vote
1 answer
2k 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 ...
Oreganop's user avatar
0 votes
1 answer
82 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 = ...
Jack's user avatar
  • 93
-1 votes
1 answer
527 views

SAQL to find the remaining days in the year?

I want to found the count of days remaining in the year in SAQL . q= foreach q generate daysbetween(toDate(date_to_epoch(year_start_day))-now()) as 'daysRemaining' I want apply formula 365-now() in ...
jessy's user avatar
  • 29