Skip to main content

When I write SAQL query in aan Einstein Analytics widget it is working fine but I need to implement the same logic in a field in computeCompute 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=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’;

q_B = filter q by date(‘filedName_Year’, ‘filedName_Month’, ‘filedName_day’)So can we get the balance till the end of the previous month in [..”2 Month Ago”];

##TO GET BALANCE TILL THE END OFa separate field and Balance till 3 MONTH AGO FROM CURRENT DATE##

q_C = filter q by date(‘filedName_Year’, ‘filedName_Month’, ‘filedName_day’)Months Ago in [..”3 Month Ago”];a separate field in "Compute Expression / Compute Relative" so that I can Subtract both?

result = group q_A by all full, q_B by all, q_C by all;or

result = foreach result generate sum(q_A.’Balanace’) as ‘Balance till the end of previous month’, sum(q_B.’Balanace’) as ‘BalanceCan I use a Date function in Salesforce to get Balance till the end of 2 months ago’ sum(q_C.’Balanace’) as ‘BalanceLast Month & Balance till the end of 3 months ago’;

“So can we get the balance till the end of previous month in a separate filed and balance till 3 Months Ago In a Separate Filed in ‘Compute Expression/ Compute Relative’ so that I can Subtract both”??.

(Or)Months Ago in separate fields in Salesforce if we already have Balance filed in Salesforce object?

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 of Balance filed in Salesforce object??.

When I write SAQL query in a Einstein Analytics widget it is working fine but I need to implement 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 previous month in a separate filed and balance till 3 Months Ago In a Separate Filed 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 of Balance filed in Salesforce object??.

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?

Source Link

I created a balance field in compute expression,I want to add a new filed in cmp exp and write SAQL to get balance till end of month any help please?

When I write SAQL query in a Einstein Analytics widget it is working fine but I need to implement 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 previous month in a separate filed and balance till 3 Months Ago In a Separate Filed 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 of Balance filed in Salesforce object??.