Questions tagged [saql]

SAQL - Salesforce Analytical Query Language

49 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
3
votes
2answers
2k 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
0answers
54 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
1answer
187 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
153 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
80 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. ...
1
vote
1answer
157 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 ...
1
vote
0answers
139 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
0answers
63 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
189 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
0answers
369 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
1answer
397 views

How to edit step-calculated metric formats?

When metrics are calculated from a step, and not in the source database, how can the format the calculated metric be edited? Perhaps the JSON or the XMD (where would this live for the calculated ...
1
vote
2answers
3k 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
702 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
103 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
169 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
1answer
23 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
0answers
13 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
30 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
47 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
32 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
0answers
42 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
38 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
139 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
437 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
0answers
239 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 ...
0
votes
1answer
123 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
1answer
513 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
1answer
171 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
346 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
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
957 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 ...
0
votes
0answers
393 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
302 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
165 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
402 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
0answers
247 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 ...
0
votes
1answer
66 views

How to prevent a filter in the UI from affecting one of my tables

I have the following problem. I have a Data Set A in which I have created several charts with their tables. There is a filter panel at the top where any change you make to these filters is reflected ...
0
votes
1answer
154 views

How to get row with rows salesforce opportunity id from a dataset of Opportunity History(Left) and opportunity(Right)

Below is the SAQL being tried by me. q = load "RELAOpportunityDataset"; q = filter q by 'Opportunity.OpptyRecType.Name' == "RELA Opportunity"; q = foreach q generate q.'Opportunity.Id' as '...
0
votes
1answer
798 views

Conditional Highlighting for Widget in Einstein Analytics

Is it possible to create a conditional highlight in Einstein Analytics I have this following query: q = load "Santher2_new"; result = group q by 'categoria'; result = foreach result generate q.'...
0
votes
1answer
83 views

CoGrouped Step wont filter other steps

I have the following step built by co-grouping 2 datasets on their SIC codes so that the display shows the sum of Amount for each SIC Code Description. This works as I need it to. q1 = load "...
0
votes
1answer
634 views

“No results found” data type for Wave

I'm trying to do some basic error handling in SAQL. We have a binding that gives as a result "No result found" both in the SAQL editor and in the actual step. I'm trying to capture the data type of ...
0
votes
1answer
684 views

Wave Einstein Analytics filter relative dates in dataflow with filter node

I need to filter opportunities in my dataflow that have a date 'last month' to 'end of current year'. I cannot use filters in the sfdcDigest node as I am doing a couple of calculations later that need ...
0
votes
1answer
1k views

SAQL- How to group by AccountID and report the first value in a table?

I am currently looking to de-duplicate data in a dataset. Reason being, I need to group together all accounts reporting on a criteria, so we may then sum and total the values of each account to get an ...
0
votes
2answers
688 views

Incompatible types: STRING and NUMERIC

I'm attempting to change the dates on some data within Wave Analytics to get the correct time zone showing, but I'm getting the error "Incompatible types: STRING and NUMERIC" whenever I attempt the ...
0
votes
2answers
367 views

Perform measure calculation with the saql compact form

for the step clause "measures" using the saql compact form, is possible to make arithmetical calculation like sum(AMOUNT)/sum(WEIGHT) without a compare table? The following example explain what i mean:...
0
votes
1answer
582 views

Concatenation of fields and text in Compact filter

I have this statement in SAQL q = foreach q generate Region, TerritoryRMA, ContactSysId, PurposeTopic, HasActivityFlag, 'Territory'+\"~~~\"+'Flag' as TFlag; q = filter q by TFlag in {{selection(...
0
votes
2answers
345 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
4answers
4k views

How to convert decimals to a percentage in Wave Saql query result

I want to show the reuslt with the percentage, what should I do?
-1
votes
1answer
167 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 ...