Skip to main content
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

1 Solution

Accepted Solutions
tresesco
MVP
MVP

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
tresesco
MVP
MVP

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

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