Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
Ayden
Contributor III
Contributor III

second day of the month set analysis

hello all,

I am creating an app that looks at the second day of the month.

I want to create a set analysis that sums the data based on the second day of each month. I tried and searched with no luck.

this is what i have done. I used month start to look at the first day of the month, but how do i get the 2nd day of the month.

LET vFisrtDate =MonthStart(Today());

sum({<Date = {"$(=vFisrtDate)"}>}[ Amount])

This does the sum for 12/1/2022. But what i need is to do a sum based on 12/2/2022.

reason been the data is updated on 2nd day monthly.

Thanks All.

Labels (4)
2 Solutions

Accepted Solutions
Or
MVP
MVP

Just add +1 to the date, either when setting the variable or in the set analysis, e.g.

MonthStart(Today())+1;

View solution in original post

vinieme12
Champion III
Champion III

as @Or suggested, you can try below

LET vFisrtDate = MonthStart(Today()) + 1;

sum({<Date = {"$(=DATE(vFisrtDate))"}>}[ Amount])

OR

LET vFisrtDate = MAKEDATE (Year(Today()) ,Month(Today()), 2 )

sum({<Date = {"$(=vFisrtDate)"}>}[ Amount])

Vineeth Pujari
If a post helps to resolve your issue, please accept it as a Solution.

View solution in original post

4 Replies
Or
MVP
MVP

Just add +1 to the date, either when setting the variable or in the set analysis, e.g.

MonthStart(Today())+1;

Ayden
Contributor III
Contributor III
Author

when i did this it added 1 month not day. Thanks

Or
MVP
MVP

That seems unlikely, as adding 1 to a date adds a day.

You could also use MakeDate(Year(Today(),Month(Today()),2), I suppose.

vinieme12
Champion III
Champion III

as @Or suggested, you can try below

LET vFisrtDate = MonthStart(Today()) + 1;

sum({<Date = {"$(=DATE(vFisrtDate))"}>}[ Amount])

OR

LET vFisrtDate = MAKEDATE (Year(Today()) ,Month(Today()), 2 )

sum({<Date = {"$(=vFisrtDate)"}>}[ Amount])

Vineeth Pujari
If a post helps to resolve your issue, please accept it as a Solution.