Wave / EA: Counting the number of weeks, months, days, etc. in SAQL

This was for some reason harder than it should have been. Needed to create the number of weeks from the beginning of the year to today. Re-posting this really because there are not a lot of examples out on the web.

date_diff(“week”,toDate(“2018-01-01″,”yyyy-MM-dd”), now()) as ‘YearlyGoal’

I will go back later to make the start of the year to be dynamic but for now this will do. Also watch out for this quote: “ instead of ” in the examples. It will total throw an error that will point you in the wrong direction.

Love Wave and EA but wish their community was more open like StackExchange, searching is dreadful and requires a login but this was the article that I used to troubleshoot: https://success.salesforce.com/_ui/core/chatter/groups/GroupProfilePage?g=0F9300000009MBPCA2&fId=0D53A00003dGrNGSA0


Leave a Reply

Your email address will not be published. Required fields are marked *