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

Announcements
Want to see what's currently in public preview? We've pulled it all together in one place. Check it out here
cancel
Showing results for 
Search instead for 
Did you mean: 
haymarketpaul
Creator III
Creator III

Set Analysis Syntax Help

I think there is something wrong with the Year([Count Date}) part of my set analysis but i'm not sure what

here are various efforts i've tried so far to no avail....

=Count({$<[Table Name]={'Contacts'},Year([Count Date])={">=2015"}>}[Row Count])

=Count({$<[Table Name]={'Contacts'},Year([Count Date])={'>=2015'}>}[Row Count])

=Count({$<[Table Name]={'Contacts'},Year([Count Date])>={"2015"}>}[Row Count])

I need to specify Year([Count Date])>=2015

Any pointers please

Labels (1)
1 Solution

Accepted Solutions
tresB
Champion III
Champion III

You have to use Year field like:

=Count({$<[Table Name]={'Contacts'},YearField={'>=2015'}>}[Row Count])

If you don't a year field and don't want to create one in the script, you can try an alternate way, like:

=Count({$<[Table Name]={'Contacts'},[Count Date]={'>=$(=YearStart(MakeDate(2015,1,1)))'}>}[Row Count])

View solution in original post

3 Replies
tresB
Champion III
Champion III

You have to use Year field like:

=Count({$<[Table Name]={'Contacts'},YearField={'>=2015'}>}[Row Count])

If you don't a year field and don't want to create one in the script, you can try an alternate way, like:

=Count({$<[Table Name]={'Contacts'},[Count Date]={'>=$(=YearStart(MakeDate(2015,1,1)))'}>}[Row Count])

sunny_talwar
MVP
MVP

I would suggest calculating Year([Count Date]) in a field to make a new field called Year and then use it in the set analysis:

LOAD *,

          Year([Count Date]) as Year

FROM Source;

=Count({$<[Table Name]={'Contacts'},Year={">=2015"}>}[Row Count])

=Count({$<[Table Name]={'Contacts'},Year={'>=2015'}>}[Row Count])

=Count({$<[Table Name]={'Contacts'},Year={"2015"}>}[Row Count])

haymarketpaul
Creator III
Creator III
Author

Great thanks Both - Have made a year field - working nicely now