Questions tagged [saql]

SAQL - Salesforce Analytical Query Language

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

Can compare tables in Einstein calculate the difference between a field on the active record where the dash displays and all other records?

I am trying to build a component that 1) calculates the average of a field (using a compare table) and then 2) Calculates the difference from that average AND the field on the current record I imbed ...
0
votes
1answer
24 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
0answers
35 views

SAQL / Einstein Analytics query multiple relative date filters

How do I apply additional date filter logic to a query as shown here where grouping by date case closed (month)? I need to add an additional constraint for each month group where only cases created ...
0
votes
1answer
29 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
52 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
24 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
74 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
138 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
0answers
32 views

Union of two columns for displaying single stack bar chart

I am stuck with Einstein analytics union action. Scenario: I have 3 columns Column A, Column B and Column C with value Column A-B.There is a grouping with one salesforce field. The challenge over ...
0
votes
1answer
95 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
31 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
0answers
116 views

Windowing Function in Einstein Analytics dataflow - SAQL?

Is it possible to use a windowing function in Einstein Analytics dataflow?(trying to use 'Running Total') Currently using computeRelative to group the data by a dimension, ordering it by date (...
0
votes
1answer
355 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
406 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 ...
0
votes
0answers
207 views

In Einstein Analytics Dataflow, how to calculate first, 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": I created the ...
1
vote
1answer
220 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
55 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
127 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
41 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
116 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
104 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 ...
1
vote
0answers
129 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
331 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
61 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
172 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
51 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
453 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
336 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
213 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
158 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
332 views

Filter dataset by column from an another dataset

I want to filter my Date datasets by Holidays datasets with something like that : a = load "Date_Test"; b = load "Holidays_Test"; b = foreach b generate 'Holidays' as 'Holidays'; a = filter a by '...
0
votes
1answer
362 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
825 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
31 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
909 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 ...
-1
votes
1answer
159 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 ...
0
votes
0answers
338 views

Filter Data Based On Values Matching In Two Columns

Is it possible to filter data based on values in two columns matching in Einstein Analytics? For example, I have one column named BO Qty and another named Supply Qty. If BO Qty is 1 and Supply Qty is ...
0
votes
1answer
284 views

Einstein Analytics data binding to boolean value

I am trying to conditionally hide tabs based on the output of a certain table. Currently I am attempting to set the navigationHidden property of the page to false like so: "navigationHidden": "{{cell(...
0
votes
1answer
155 views

Wave Analytics Filter by Formula field

Is it possible to filter the rows based on the formula fields. I created a table and I only need to show rows that is not in <=-25% && >= 25%.
0
votes
1answer
356 views

SAQL to generate a field not in a group by statement

I'm a bit of a beginner to SAQL. I have been tasked with maintaining a fairly elaborate dashboard and data flow and have been asked to add some features to it. There is a lens that displays a chart ...
0
votes
2answers
562 views

How to convert decimal to percentage in saql?

How to convert decimal to percentage in saql?
1
vote
1answer
2k 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 ...
0
votes
1answer
2k 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' ...
1
vote
1answer
1k 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 ...
0
votes
1answer
306 views

Salesforce Analytics (SAQL)

I would like to pass current year( ["current Year"]) and current month ( ["current month"]) as the dynamic value for month and year instead of the hard coded value . Please let me know how I will ...
4
votes
1answer
97 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 ...
1
vote
1answer
600 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
0answers
358 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 ...
2
votes
3answers
471 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 ...
0
votes
0answers
238 views

Error when trying to loop through a SAQL query in apex

I'm trying to loop account ids through a SAQL query and store the results from the query into a list. However in the loop, the query executes for only the first id in the list fetched, for the second ...