0

Here , I'm trying to add a filter to a step named "Tech_Testing_1" using "Date binding" step named (Snapshot_Binding_1) but facing a syntax error ..

Please find the saql queries being used in the attachment with the error screenshot.

Any idea??

JSON COde:

Date Binding Step Query:-

Snapshot_Binding_1:-

q = load \"PMO_V3\";
q = group q by ('Snapshot_Date_Year', 'Snapshot_Date_Month', 'Snapshot_Date_Day');
q = foreach q generate 'Snapshot_Date_Year' + \"~~~\" + 'Snapshot_Date_Month' + \"~~~\" + 'Snapshot_Date_Day' as 'Snapshot_Date_Year~~~Snapshot_Date_Month~~~Snapshot_Date_Day';
q = order q by 'Snapshot_Date_Year~~~Snapshot_Date_Month~~~Snapshot_Date_Day' desc;\
q = limit q 1;

Using the Binding logic in the below query:-

Tech_Testing_1:-

"query": "q = load \"PMO_V3\";\r\nq = filter q by date('Snapshot_Date_Year', 'Snapshot_Date_Month', 'Snapshot_Date_Day') in [{{column(Snapshot_Binding_1.result, [\"Snapshot_Date_Year~~~Snapshot_Date_Month~~~Snapshot_Date_Day\"]).asObject()}}];\nq = group q by ('ProjectID.Name' , 'Accountjoin.Name');\r\nresult = foreach q generate sum(q.'ProjectID.TransfProject.Technology_Readiness_Status_Numerator__c') as 'A', sum(q.'ProjectID.TransfProject.Technology_Readiness_Status_Denominator__c') as 'B',row_number() over([..] partition by 'ProjectID.Name' order by 'Accountjoin.Name' desc) as 'Row Number','ProjectID.Name' as 'ProjectID.Name','Accountjoin.Name' as 'Accountjoin.Name';\r\nresult = filter result by 'Row Number' in [1];\r\nresult = foreach result generate 'A','B';\r\nresult1 = group result by 'all';\r\nresult1 = foreach result1 generate sum('A') as 'A',sum('B') as 'B';\r\nresult1 = foreach result1 generate round(((A/B)*100),2) as 'C';\r\nresult1 = limit result1 2000;",
0

You can try to add 'Snapshot_Date_Year','Snapshot_Date_Month','Snapshot_Date_Day' columns to Snapshot_Binding_1 and then try to use Data Range filter in Snapshot_Binding_1 step.

Snapshot_Binding_1:-

q = load \"PMO_V3\";
q = group q by ('Snapshot_Date_Year', 'Snapshot_Date_Month', 'Snapshot_Date_Day');
q = foreach q generate 'Snapshot_Date_Year' + \"~~~\" + 'Snapshot_Date_Month' + \"~~~\" + 'Snapshot_Date_Day' as 'Snapshot_Date_Year~~~Snapshot_Date_Month~~~Snapshot_Date_Day','Snapshot_Date_Year','Snapshot_Date_Month','Snapshot_Date_Day';
q = order q by 'Snapshot_Date_Year~~~Snapshot_Date_Month~~~Snapshot_Date_Day' desc;
q = limit q 1;

Tech_Testing_1:-

q = load "PMO_V3";
q = filter q by date('Snapshot_Date_Year', 'Snapshot_Date_Month', 'Snapshot_Date_Day') in [dateRange([{{cell(Snapshot_Binding_1.result,0,"Snapshot_Date_Year").asString()}},{{cell(Snapshot_Binding_1.result,0,"Snapshot_Date_Month").asString()}},{{cell(Snapshot_Binding_1.result,0,"Snapshot_Date_Day").asString()}}],[{{cell(Snapshot_Binding_1.result,0,"Snapshot_Date_Year").asString()}},{{cell(Snapshot_Binding_1.result,0,"Snapshot_Date_Month").asString()}},{{cell(Snapshot_Binding_1.result,0,"Snapshot_Date_Day").asString()}}])];
q = group q by ('ProjectID.Name' , 'Accountjoin.Name');
result = foreach q generate sum(q.'ProjectID.TransfProject.Technology_Readiness_Status_Numerator__c') as 'A', sum(q.'ProjectID.TransfProject.Technology_Readiness_Status_Denominator__c') as 'B',row_number() over([..] partition by 'ProjectID.Name' order by 'Accountjoin.Name' desc) as 'Row Number','ProjectID.Name' as 'ProjectID.Name','Accountjoin.Name' as 'Accountjoin.Name';
result = filter result by 'Row Number' in [1];
result = foreach result generate 'A','B';
result1 = group result by 'all';
result1 = foreach result1 generate sum('A') as 'A',sum('B') as 'B';
result1 = foreach result1 generate round(((A/B)*100),2) as 'C';
result1 = limit result1 2000;

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.