Skip to main content
Woohoo! Qlik Community has won “Best in Class Community” in the 2024 Khoros Kudos awards!
Announcements
Nov. 20th, Qlik Insider - Lakehouses: Driving the Future of Data & AI - PICK A SESSION
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

If condition convert to set analysis

Hi guys,

Just a simple query. How to convert this if condition into set analysis?

=if(EndTime <= weekstart(Today()) and EndTime >= weekend(Today()), EndTime, Null())

This code is working.. I just want to use its set analysis counterpart (if its possible)

Thanks

1 Solution

Accepted Solutions
Anonymous
Not applicable
Author

Something like this?

only({<EndTime = {"<=$(=weekstart(Today()))>=$(=date(weekend(Today())))"}>} EndTime)

View solution in original post

3 Replies
Anonymous
Not applicable
Author

Something like this?

only({<EndTime = {"<=$(=weekstart(Today()))>=$(=date(weekend(Today())))"}>} EndTime)

johnw
Champion III
Champion III

null()

In other words, the code you posted will always return null. If your application is working, you did not post the code your application is using. The end time cannot simultaneously be <= the start of the week and >= the end of the week. Since that was probably a typo, go with aby's answer. You'll probably need a date() function around weekstart() too, though.

Not applicable
Author

Ops! I pasted the wrong code. Thanks John!. Big Smile