I want to found the count of days remaining in the year in SAQL .
q= foreach q generate daysbetween(toDate(date_to_epoch(year_start_day))-now()) as 'daysRemaining'
I want apply formula 365-now() in saql
Please help me !!
Salesforce Stack Exchange is a question and answer site for Salesforce administrators, implementation experts, developers and anybody in-between. It only takes a minute to sign up.Sign up to join this community
You could do something like this to calculate each date's distance to the end of the year...
q = foreach q generate daysBetween( toDate('DATA-DATE-FIELD', "yyyy-MM-dd"), year_last_day(toDate('DATA-DATE-FIELD', "yyyy-MM-dd")) ) as 'EOY Distance';
I just tested it and it seems to work out:
Date EOY Distance ... 2014-12-30 1 2014-12-31 0 ...