Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Announcements
QlikView Fans! We’d love to hear from you.
Share your QlikView feedback with the product team… Click here to participate in our 5-minute survey.
Rules, plus terms and conditions, can be found here.
andrewmo
Contributor

Qlikview expression based on last 30 working days

Hello

I'm trying to figure out how to build an expression which does a count of an ID for the past 30 working days. I created a WeekEnd flag but I'm not getting the results I expect:

count(distinct(if(Date >= Today()-30 AND WeekEndFlag = 0,ID)))

I believe this is just omitting weekends in the past 30 days. How can I get the past 30 working days (Mon- Fri)?

Tags (1)
3 Replies
atkinsow
Valued Contributor II

Re: Qlikview expression based on last 30 working days

Try this:

=count(distinct {<Date={'>=$(=today()-30)'},WeekEndFlag={'0'}>} ID)

antoniotiman
Honored Contributor III

Re: Qlikview expression based on last 30 working days

Hi Andrew,

=NetWorkDays(Date(Today()-30),Today())

Regards,

Antonio

sasiparupudi1
Honored Contributor III

Re: Qlikview expression based on last 30 working days

Try

Date(FirstWorkDate(Today(),30),'YYYY-MM-DD')

hth

Sasi

Community Browser