I want to get the sum of Amount of the company per month (CloseDate_Month) and divide this sum by the number of CloseDate_Day in this month.
q = load "Test";
q = group q by 'CloseDate_Month';
q = foreach q generate 'CloseDate_Month' as 'CloseDate_Month', sum('Amount') as 'sum_Amount';
q = order q by 'CloseDate_Month' asc;
q = limit q 2000;
I have this code generated by my Dashboard. Now I want to divide sum('Amount')
by something like month_days('CloseDate_Day')
but I have several problems here. First, the group by who only take 'CloseDate_Month' every other token are undefined in it. Finally, 'CloseDate_Day' is not a proper date for month_days()
function.