Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi
I am trying to do some set analysis to just show results for the current year. The field I want to use for the year contains the date in the format DDMMYYYY so I am using the year() function but it appears to be giving me an error.
Does anyone know what I'm doing wrong in the expression below?
Sum({$<year(CampaignMemberCreatedDate)={2012}>} Amount__c)
Thanks
Jon
check this:
Sum({$<CampaignMemberCreatedDate={'*2012'}>} Amount__c)
try
Sum({< $(year(CampaignMemberCreatedDate))={2012}>} Amount__c)
or create a variable for year(Date)= vyear
Sum{<$(vyear)={2012}>}Amount_c)
The error is that you're trying to use expression here
Sum({$<year(CampaignMemberCreatedDate)={2012}>} Amount__c)
But only field name can be used on the left side of the equasion. That's why the suggestion from Pari Pari is technically correct.
Regards,
Michael
You don't usethe function into set analysis, else function aggragation example min,max,avg ecc.
So you have 3 possibile solution:
1)Sum({$<CampaignMemberCreatedDate={'*2012'}>} Amount__c)
2)you create a variable set pippo= '*' &YEAR(today())
Sum({$<CampaignMemberCreatedDate=$(#pippo)>} Amount__c)
or
Sum({$<CampaignMemberCreatedDate="$(#pippo)">} Amount__c)
(i dont' remeber if you to use "")
4)into a script you create YEAR(CampaignMemberCreatedDate) as ANNO
4a)Then
set pippo2= YEAR(today())
Sum({$<ANNO=$(#pippo2)>} Amount__c) or Sum({$<ANNO="$(#pippo2)">} Amount__c)
4b)
Sum({$<ANNO={'2012'}>} Amount__c)
bye Marchetto
Thanks, all!