Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

awhitfield
Esteemed Contributor

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

Re: Argh, rubbish at set analysis!

May be this

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

MVP
MVP

Re: Argh, rubbish at set analysis!

or

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

awhitfield
Esteemed Contributor

Re: Argh, rubbish at set analysis!

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

jordywegmanclim
New Contributor III

Re: Argh, rubbish at set analysis!

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

MVP
MVP

Re: Argh, rubbish at set analysis!

What does the above give you?

awhitfield
Esteemed Contributor

Re: Argh, rubbish at set analysis!

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

MVP
MVP

Re: Argh, rubbish at set analysis!

What is the Linkdate field format?

awhitfield
Esteemed Contributor

Re: Argh, rubbish at set analysis!

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 ;-)

MVP
MVP

Re: Argh, rubbish at set analysis!

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,

Community Browser