When I write SAQL query in an Einstein Analytics widget it is working fine but I need to implement the same logic in a field in Compute expression / Compute Relative;
SAQL QUERY IN THE WIDGET:
q=load “dataset”;
##TO GET BALANCE TILL THE END OF PREVIOUS FROM CURRENT DATE##
q_A = filter q by date(‘filedName_Year’, ‘filedName_Month’, ‘filedName_day’) in [..”1 Month Ago”];
##TO GET BALANCE TILL THE END OF 2 MONTHS AGO FROM CURRENT DATE##
q_B = filter q by date(‘filedName_Year’, ‘filedName_Month’, ‘filedName_day’) in [..”2 Month Ago”];
##TO GET BALANCE TILL THE END OF 3 MONTH AGO FROM CURRENT DATE##
q_C = filter q by date(‘filedName_Year’, ‘filedName_Month’, ‘filedName_day’) in [..”3 Month Ago”];
result = group q_A by all full, q_B by all, q_C by all;
result = foreach result generate sum(q_A.’Balanace’) as ‘Balance till the end of previous month’, sum(q_B.’Balanace’) as ‘Balance till the end of 2 months ago’ sum(q_C.’Balanace’) as ‘Balance till the end of 3 months ago’;
So can we get the balance till the end of the previous month in a separate field and Balance till 3 Months Ago in a separate field in "Compute Expression / Compute Relative" so that I can Subtract both?
or
Can I use a Date function in Salesforce to get Balance till the end of Last Month & Balance till the end of 3 Months Ago in separate fields in Salesforce if we already have Balance filed in Salesforce object?