Qlik Community

QlikView App Development

Discussion Board for collaboration related to QlikView App Development.

Announcements
Modernize Your QlikView Deployment webinar, Nov. 3rd. REGISTER
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Not applicable

Using YEAR function in Set Analysis

Hi,

I'm trying to use the Year function in Set Analysis in the following context, but no data are returned. Could anyone advise where I'm going wrong? The formula works normally until I introduce the fourth 'year(INT_DATE)={2014}' condition. I have tried enclosing '2014' in single and double quotes with no luck (when the formula is working as it is, the '2014' will likely be replaced by a variable):

COUNT({$<INT_ACTIVITY_CLASS_INDEX={0},INT_USER_LISTING_ID={2},SEARCH_INDEX={1}, year(INT_DATE)={2014}>} INT_ACTIVITY_ID)

Thanks.

Gavin

1 Solution

Accepted Solutions
Highlighted
MVP
MVP

You can't use year(INT_DATE).... it should not be a function but should be a field.

GO to your script and create one more line

year(INT_DATE) as Year


and now use


Year = {2014} or

Year = {'2014'}

View solution in original post

5 Replies
Highlighted
MVP
MVP

You can't use year(INT_DATE).... it should not be a function but should be a field.

GO to your script and create one more line

year(INT_DATE) as Year


and now use


Year = {2014} or

Year = {'2014'}

View solution in original post

Highlighted
Not applicable

Manish is correct. If you want to avoid that and use it in expression, write this

COUNT({$<INT_ACTIVITY_CLASS_INDEX={0},INT_USER_LISTING_ID={2},SEARCH_INDEX={1}>} if(year(INT_DATE)=2014,INT_ACTIVITY_ID))

Highlighted
Not applicable

Thank you both.

Highlighted
Contributor III
Contributor III

Hi all,

I have a question, I have a filed - Open Date Time and this field format is as follows:

DD/MM/YYY HH:MM:SS

I would like to be able  to create, in my script, a YEAR() function referring to this field and gathering per year....

Anyone has an idea?

Thanks

Nelson.

Highlighted
Contributor III
Contributor III

Hi all,

I have a question, I have a filed - Open Date Time and this field format is as follows:

DD/MM/YYY HH:MM:SS

I would like to be able to create, in my script, a YEAR() function referring to this field and gathering per year....

Anyone has an idea?

Thanks

Nelson.