Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Independent validation for trusted, AI-ready data integration. See why IDC named Qlik a Leader: Read the Excerpt!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Exclude only 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

2 Replies
MindaugasBacius
Partner - Specialist III
Partner - Specialist III

1. Make two flags in your load scrip:

    If(weekday(Date) = 6, 1, 0) as Flag_Sunday

    If(weekday(Date) = 5 or weekday(Date) = 6, 1, 0) as Flag_Saturday_Sunday

    

     And use set analysis in calculations.


2. Or make Weekday field and use it also in set analysis.

marcus_sommer

In addition to the suggestion from mindaugasbacius you could also reverse the logic by creating a flag for a working day  to calculate later directly with the flag without the need of set analysis:

If(weekday(Date) < 5, 1, 0) as Flag_Workingday

and then within your objects: sum(AnyValue*Flag_Workingday)

- Marcus