Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Exclude sunday

Hi ,

1) how can i calculated the data excluding only sunday's in a year .

2) how can i calculated the data excluding both saturday and  sunday's in a year .

Thanks in advance

10 Replies
MK_QSL
MVP
MVP

1) Where you want to exclude... Front end or back end?

2) exclude means what here? You don't want to load those records or want to exclude them while doing some calculations?

santiago_respane
Specialist
Specialist

Hi Anusha,

what do you mean by calculate? in the front end or in the loading script.

There are a lot of ways for achieving this using:

-networkdays

-weekday

-Etc

Please elaborate more in order to be able to help you.

Kind regards,

PrashantSangle

Hi,

If you want to count no of days in year excluding sunday

then in script create flag to identify sunday

like if(wildmatch(Weekday(datefield),'Sunday'),'weekend','weekday') as flag

and in front end use

count({<flag={'weekday'}>}datefield)

2: If you want to exclude Saturday and Sunday both then use networkday()

Kind Regards

Great dreamer's dreams never fulfilled, they are always transcended.
Please appreciate our Qlik community members by giving Kudos for sharing their time for your query. If your query is answered, please mark the topic as resolved 🙂
avinashelite

1) how can i calculated the data excluding only sunday's in a year .

* You can create a flag in your master calendar for identifying the Sunday ..like

if(weekday(date_field)='Sun',1,0) as Sunday_flag, while doing the calculation using this flag to eliminate the Sunday values

2) how can i calculated the data excluding both saturday and  sunday's in a year .

* you Networkingdays() function it will automatically eliminate the Saturday and Sunday

Anonymous
Not applicable
Author

Backend ..

Anonymous
Not applicable
Author

Hi,

in the script for Exclude Saturday and Sunday.

Load your data in a Temp table and at the end do this :

TBLFACT_TEMP:

noconcatenate LOAD *,

if(weekday(Date)>4,'X') as Weekend     //This for identify Saturday and Sunday for only sunday put > 5

RESIDENT TBLFACT;

Drop Table TBLFACT;

TBLFACT:

noconcatenate LOAD *

RESIDENT TBLFACT_TEMP 

where Weekend <> 'X';

DROP TABLE TBLFACT_TEMP

Regards,

Emilien

Anonymous
Not applicable
Author

Thanks...

Anonymous
Not applicable
Author

Thanks...