Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik GA: Multivariate Time Series in Qlik Predict: Get Details
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Set analysis error

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

1 Solution

Accepted Solutions
Not applicable
Author

check this:

Sum({$<CampaignMemberCreatedDate={'*2012'}>} Amount__c)

View solution in original post

5 Replies
Not applicable
Author

check this:

Sum({$<CampaignMemberCreatedDate={'*2012'}>} Amount__c)

rajni_batra
Specialist
Specialist

try

Sum({< $(year(CampaignMemberCreatedDate))={2012}>} Amount__c)

or create a variable for year(Date)= vyear

Sum{<$(vyear)={2012}>}Amount_c)

Anonymous
Not applicable
Author

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

Not applicable
Author

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

Not applicable
Author

Thanks, all!