Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
awhitfield
Partner - Champion
Partner - Champion

Argh, rubbish at set analysis!

I am trying to calculatte Count(distinct [Attendance ID]) where WeekStart(Today() = WeekStart(Linkdate)

Give me a clue please?

Andy

17 Replies
sunny_talwar

May be this

Count(DISTINCT {<Linkdate = {"=WeekStart(Linkdate) = WeekStart(Today())"}>} [Attendance ID])

sunny_talwar

or

Count(DISTINCT {<Linkdate = {"$(='>=' & WeekStart(Today()) & '<' & WeekStart(Today(), 1))"}>} [Attendance ID])

awhitfield
Partner - Champion
Partner - Champion
Author

Sorry should have said I need the total for the current week

JordyWegman
Partner - Master
Partner - Master

You try: Count(Distinct {$< Linkdate = {"=WeekStart(LinkDate) = WeekStart(Today())"}>} [Attendance ID])

Work smarter, not harder
sunny_talwar

What does the above give you?

awhitfield
Partner - Champion
Partner - Champion
Author

Unfortunately the same as Count(distinct [Attendance ID])

sunny_talwar

What is the Linkdate field format?

awhitfield
Partner - Champion
Partner - Champion
Author

Hi sonny,

it was  Date(Floor(fk_date),'YYYY-MM-DD')AS LinkDate,

then changed it to 

Date(Floor(fk_date),'YYYY/MM/DD')AS LinkDate,

But didn't make any difference 😉

sunny_talwar

Try this

Count(DISTINCT {<Linkdate = {"$(='>=' & Date(WeekStart(Today()), 'YYYY/MM/DD') & '<' & Date(WeekStart(Today(), 1), 'YYYY/MM/DD'))"}>} [Attendance ID])

With this

Date(Floor(fk_date),'YYYY/MM/DD')AS LinkDate,