Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Announcements

Breathe easy -- you now have more time to plan your next steps with Qlik!
QlikView 11.2 Extended Support is now valid through December 31, 2020. Click here for more information.

Not applicable

how to write a set analysis for sql between function

I have from date and to date multiselect fileds and i want to show orders between these two date's. How to write it in set analysis?

Tags (1)
3 Replies
NickHoff
Valued Contributor

Re: how to write a set analysis for sql between function

You don't need set analysis, you could use interval match, see the following post.

http://community.qlik.com/blogs/qlikviewdesignblog/2013/04/04/intervalmatch

Employee
Employee

Re: how to write a set analysis for sql between function

Interval match is the more elegant way to do it. 

If you have other reasons, you can capture your FROM and TO dates as variables  ex:

vFromDate:   =min([FromDate])

vToDate:        min([ToDate])

And then in your expression write the SET statement like this:

sum(   {$<[OrderDate={'>=$(vFromDate)<=$(vToDate)'}>}   OrderAmount )

Not applicable

Re: how to write a set analysis for sql between function

Hi,

sum(   {$<[OrderDate={'>=$('start date'<='end date)}>}   OrderAmount:

Community Browser