Salesforce Certified Tableau CRM and Einstein Discovery Consultant — Question 16

The client is trying to create a SAQL query to predict sales in each sales region. They cannot get the query to return any results, but have identified that the enror is in the timeseries statement. They have asked a Tableau CRM Consultant to review the following query and fix any errors. q = load "sales"; q = group q by ('Date_Year', 'Date_Month', 'Region'); q = foreach q generate 'Date_Year', 'Date_Month', 'Region', sum('Sales') as 'sum_Sales'; q = timeseries q generate 'sum_Sales' as 'Forecasted_Sales' with (dateCols=('Date_Year', 'Date_Month', "Y-M"), partition='Region'); q = foreach q generate 'Date_Year' + "~~~" + 'Date_Month' as 'Date_Year~~~Date_Month', 'Region', coalesce('sum_Sales', 'Forecasted_Sales') as 'Sales'; q = order q by ('Date_Year~~~Date_Month' asc, 'type' asc); q = limit q 2000;
Which timeseries statement will fix the query?

Answer options

Correct answer: C

Explanation

The correct answer is C because it correctly specifies the partition by 'Region' and uses 'Date_Quarter' for the date column, which aligns with the expected format for a timeseries analysis. Option A incorrectly includes 'ignoreLast=true', option B uses the wrong date column 'Date_Month', and option D adds unnecessary seasonality that isn't required for the query.