Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- q = load "opportunity";
- q_A = filter q by date('CloseDate_Year','CloseDate_Month', 'CloseDate_Day') in ["current fiscal_year" .. "current day"];
- q_B = filter q by date('CloseDate_Year','CloseDate_Month', 'CloseDate_Day') in ["1 fiscal_year ago" .. "current day - 1 year"];
- result = group q_A by 'Account.Name' full, q_B by 'Account.Name';
- result = foreach result generate coalesce(q_A.'Account.Name', q_B.'Account.Name') as 'Account.Name', sum(q_A.'Amount') as 'ytd', sum(q_B.'Amount') as 'pytd';
- result = order result by ('Account.Name' asc);
- result = limit result 2000;
Add Comment
Please, Sign In to add comment