function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Brian Good 13Brian Good 13 

SAQL Query coalese and case formula

I've inserted a simple case formula into my SAQL query when constructing tables to change the month number into the name:
 
(case 'custom_field_Month' when "01" then "January" when "02" then "February"  when "03" then "March"  when "04" then "April"  when "05" then "May"  when "06" then "June"  when "07" then "July"  when "08" then "August"  when "09" then "September"  when "10" then "October"  when "11" then "November" else "December" end) as 'Month_Name'
 
However, I'm trying to insert it into a table with multiple coalesce functions and I'm not quite sure where to put it.  I've tried a few places but continually get errors when trying to run the query (I've run into the Cogroup projection idtoken requires stream identifier - error most often).  Any help on where this case formula should go (do I need to put it multiple times in the each of the "result = foreach result generate..." line?)  Here is an example of my SAQL table query:
 
q = load "ProposalandContractData";
q = filter q by 'xs_Final_Version__c' == "true";
q_A = filter q by date('xs_Client_Submission_Date__c_Year', 'xs_Client_Submission_Date__c_Month', 'xs_Client_Submission_Date__c_Day') in ["current fiscal_year".."current fiscal_year"];
q_B = filter q by date('xs_Client_Submission_Date__c_Year', 'xs_Client_Submission_Date__c_Month', 'xs_Client_Submission_Date__c_Day') in ["current fiscal_year".."current fiscal_year"];
q_A = group q_A by rollup('xs_Client_Submission_Date__c_Month');
q_A = order q_A by ('xs_Client_Submission_Date__c_Month' asc nulls first);
q_B = group q_B by rollup('xs_Client_Submission_Date__c_Month');
q_B = order q_B by ('xs_Client_Submission_Date__c_Month' asc nulls first);
result = group q_A by 'xs_Client_Submission_Date__c_Month' full, q_B by 'xs_Client_Submission_Date__c_Month';
result = foreach result generate coalesce(q_A.'xs_Client_Submission_Date__c_Month', q_B.'xs_Client_Submission_Date__c_Month') as 'xs_Client_Submission_Date__c_Month', count(q_A) as 'A', sum(q_B.'Total_Fees_Proposed__c') as 'B', coalesce(grouping(q_A.'xs_Client_Submission_Date__c_Month'), grouping(q_B.'xs_Client_Submission_Date__c_Month')) as 'grouping_xs_Client_Submission_Date__c_Month';
summary = filter result by 'grouping_xs_Client_Submission_Date__c_Month' == 1;
result = filter result by 'grouping_xs_Client_Submission_Date__c_Month' == 0;
result = order result by ('xs_Client_Submission_Date__c_Month' asc nulls last);
result = limit result 2000;
result = union result, summary;
VinayVinay (Salesforce Developers) 
You can reach out Tableau CRM group on
https://trailhead.salesforce.com/trailblazer-community/groups/0F9300000009MBPCA2?tab=discussion for inputs on your ask.

Thanks,