Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
yoganantha321
Creator II
Creator II

Separate the weekends

Hi all,

I have a data set as list of dates with the type as shown in image1. But i need a new type as weekends as shown in image 2. 

image1.PNGimage2.PNG

 

Anybody help in this!!!!

I have attached a sample file along with this.

 

 

Regards,

Yoganantha Prakash G P

Labels (1)
1 Solution

Accepted Solutions
PradeepReddy
Specialist II
Specialist II

See the attachment..

the solution is little bit lengthy..

View solution in original post

8 Replies
tresesco
MVP
MVP

May be like:

If(Match(Weekday([End Day]), 'Sat', 'Sun'), 'Weekend', Type) as Type
yoganantha321
Creator II
Creator II
Author

Hi Tresesco,
As shown in the first image in between the weekends appear it should be automatically generate start date and end date as shown image 2
tresesco
MVP
MVP

So first image is your input and second one is expected output, right? If so, could you explain the logic a bit more, like how exactly you get second row of End Date (7/12/2018)?

uacg0009
Partner - Specialist
Partner - Specialist

I think because the 8/12/2018 is Sat, so the vacation is till to 7/12/2018.
yoganantha321
Creator II
Creator II
Author

Yes Tresesco!!!

As said by Uacg0009

PradeepReddy
Specialist II
Specialist II

See the attachment..

the solution is little bit lengthy..

yoganantha321
Creator II
Creator II
Author

Thanks Pradeepreddy

uacg0009
Partner - Specialist
Partner - Specialist

Actually last night, I also created a solution, but didn't upload it...

But it's fine, you can check my script.

Thanks

Aiolos