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

Announcements
Qlik Connect 2026 Agenda Now Available: Explore Sessions
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Monthstart Function in a set analysis

Hello,

I'm trying to use this syntax in my set analysis, but a i have always a return of 0.

=Sum ({1 < ORDERED_DATE = {">= $(=Monthstart(vMaxDate))" } > }  ORDERED_AMOUNT_CHF)

ORDERED_DATE is a date and vMaxDate a Date variable.

Wath's wrong?

Thanks

1 Solution

Accepted Solutions
alexandros17
Partner - Champion III
Partner - Champion III

Hi Jelpache,

I've simulated the problem and my expression

sum({$ <datestart={'>=$(=monthstart(vOggi))'}>} 1)  (equal to yours) works. what you must check is if one of the dates (probably

ORDERED_DATE) is date-time, in this case convert it to date and try again

View solution in original post

6 Replies
alexandros17
Partner - Champion III
Partner - Champion III

Are you sure that both date have the same format?

Not applicable
Author

=Sum ({$ < ORDERED_DATE = {">= $(=Monthstart(date(vMaxDate)))" } > }  ORDERED_AMOUNT_CHF)

rajni_batra
Specialist
Specialist

store

(=Monthstart(vMaxDate))"  in a variable and check is the date format same for both the dates you r comparing in ur expression & then apply it or u can use new created variable also.

Anonymous
Not applicable
Author

Always a result of 0.

Anonymous
Not applicable
Author

You right we use a date format 'YYYY-MM-DD' for the ORDERED_DATE and the same for vMaxDate.

With this formula for only the vMaxDate

=Sum ({1< ORDERED_DATE={"$(=vMaxDate)"}>}ORDERED_AMOUNT_CHF)

I have the total amount for this day.  In this case the date format is valid at the both side.

I have also try some date formating of the monthstart but without any success.

alexandros17
Partner - Champion III
Partner - Champion III

Hi Jelpache,

I've simulated the problem and my expression

sum({$ <datestart={'>=$(=monthstart(vOggi))'}>} 1)  (equal to yours) works. what you must check is if one of the dates (probably

ORDERED_DATE) is date-time, in this case convert it to date and try again