Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

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
1 Solution

Accepted Solutions
tamilarasu
Champion
Champion

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
tamilarasu
Champion
Champion

Hi Sampath,

Try,

Date:

Load [Actual Date],

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

From

......

petter
Partner - Champion III
Partner - Champion III

You can use this expression:

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

Chanty4u
MVP
MVP

try this

Date(

MonthStart("Actual Date")

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

) as NewDay

tamilarasu
Champion
Champion

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))

petter
Partner - Champion III
Partner - Champion III

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....

tamilarasu
Champion
Champion

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

Capture.PNG

petter
Partner - Champion III
Partner - Champion III

thanks - you too!

Anonymous
Not applicable
Author

thanks to all for the help