Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

5 days a week

How can i count with 5 days in a week. I want only count with the workdays (5) in the week. Exemple: when it is sunday and i want to a total of one day ago so i will see the total of fryday. 2 days ago than it is the total of thursday. If it is Wednesday i will see Monday and  Tuesday. My definitie is now
sum(if ([CapDatumAchterstand] < ( vToday ),[CapInUrenAchterstand]))
and
sum(if ([CapDatumAchterstand] < ( vToday--1),[CapInUrenAchterstand]))
18 Replies
Not applicable
Author

Stefan,

Here are my QV application.

Gerrit

-


swuehl <qliktech@sgaur.hosted.jivesoftware.com> schreef:

swuehl swuehl created the discussion

"Re: 5 days a week"

To view the discussion, visit: http://community.qlik.com/message/166906#166906

swuehl
MVP
MVP

Gerrit,

your app has an OnOpen event that reloads, which of course does not work at my site, so I don't see any data.

Could you please deactivate the reload and exchange the app?

Not applicable
Author

Stefan,

Now without reloading.

Gerrit

-


swuehl <qliktech@sgaur.hosted.jivesoftware.com> schreef:

swuehl swuehl created the discussion

"Re: 5 days a week"

To view the discussion, visit: http://community.qlik.com/message/167135#167135

swuehl
MVP
MVP

Ok, what would be the expected results then for today?

Not applicable
Author

Today result:

1 workday in the past: 01-01-2011 till 21-11-2011

2 workdays in the past: 01-01-2011 till 18-11-2011

Gerrit

swuehl
MVP
MVP

Ok, I undestand, but the actual expected numbers?

Using

=sum(if ( CapDatumAchterstand < FirstWorkDate( vToday-1,2),[CapInUrenAchterstand]))

for 2 workdays in the past (I noticed I need to subtract 1day for actually getting the correct results, because FirstWorkDate will also take the enddate into account).

I get:

Kstplts Per Dag Gevraagde Capaciteit Cap. per aant. Dgn In % Achterstand t/m 1 dag terug Achterstand t/m 2 dagen terug sum(if ( CapDatumAchterstand < FirstWorkDate( vToday-1,2),[CapInUrenAchterstand]))
105 339 199 339 59% 948 708 501,2
110 107 187 107 174% 1899 1788 1666,51
115 60 85 60 142% 36 20 6,88
120 58 38 58 67% 88 78 66,08
125 45 62 45 139% 173 162 144,18
130 38 2 38 6% 12 12 11
150 38 5 38 13% 161 160 159
Not applicable
Author

Stefan,

What do you mean with: but the actual expected numbers?

Kind regard,

Gerrit

-


swuehl <qliktech@sgaur.hosted.jivesoftware.com> schreef:

swuehl created the discussion

"Re: 5 days a week"

To view the discussion, visit: http://community.qlik.com/message/167164#167164

swuehl
MVP
MVP

Well, I mean the numbers you expect to show up in your table, or do I misunderstand something completely?

Anyway, what about the numbers I posted above (most right column)?

Not applicable
Author

Stefan,

Thanks a lot. The numbers are correct.

Kinf regards

Gerrit

-


swuehl <qliktech@sgaur.hosted.jivesoftware.com> schreef:

swuehl created the discussion

"Re: 5 days a week"

To view the discussion, visit: http://community.qlik.com/message/167191#167191