Qlik Community

QlikView App Development

Discussion Board for collaboration related to QlikView App Development.

Announcements
QlikWorld 2020: Join us May 11 - 14, 2020 in Phoenix, AZ. Register early and save $400. Learn More
kanimozhi
New Contributor III

how to find first wednesday date from every month

hi all,

i need to populate a date from 1st wendenday of everymonth. means i have my dates like 'Actual Date' Column but i need to derive the date as per 'Required Output' columns. Any help. TIA

  

Actual DateRequired Output
30/12/20176/12/2017
15/12/20176/12/2017
3/12/20176/12/2017
3/1/20183/1/2018
1/1/20183/1/2018
17/1/20183/1/2018
1/2/20187/2/2018
20/2/20187/2/2018
Tags (1)
1 Solution

Accepted Solutions

Re: how to find first wednesday date from every month

Hi Petter,

I think you have to change 9 to 10. Correct me if I am wrong.

Date(MonthStart([Actual Date])+FMod(10-Weekday(MonthStart([Actual Date])),7))

View solution in original post

8 Replies

Re: how to find first wednesday date from every month

Hi Sampath,

Try,

Date:

Load [Actual Date],

WeekStart(MonthStart([Actual Date]),1,2) as [Required Output]

From

......

MVP
MVP

Re: how to find first wednesday date from every month

You can use this expression:

  Date(MonthStart([Actual Date])+FMod(9-Weekday(MonthStart([Actual Date])),7))

Chanty4u
Esteemed Contributor III

Re: how to find first wednesday date from every month

try this

Date(

MonthStart("Actual Date")

+ (2 - weekday(MonthStart("Actual Date")))

) as NewDay

Re: how to find first wednesday date from every month

Hi Petter,

I think you have to change 9 to 10. Correct me if I am wrong.

Date(MonthStart([Actual Date])+FMod(10-Weekday(MonthStart([Actual Date])),7))

View solution in original post

MVP
MVP

Re: how to find first wednesday date from every month

I guess your week for your country settings start on a different day of the week than mine. So it would be 9 for me and 10 for you. However I find tamilarasu‌'s solution much more elegant - I wasn't aware of the WeekStart() function in Qlik....

Re: how to find first wednesday date from every month

Ah got it. Thanks Petter. Have a fantastic day!

Capture.PNG

MVP
MVP

Re: how to find first wednesday date from every month

thanks - you too!

kanimozhi
New Contributor III

Re: how to find first wednesday date from every month

thanks to all for the help