Qlik Community

QlikView App Development

Discussion Board for collaboration related to QlikView App Development.

Announcements
Make your voice heard! Participate in the 2020 Wisdom of Crowds® Survey. BEGIN SURVEY
Highlighted
Not applicable

Set Analysis with a Date field is not working properly

I have this Set Analysis that should show the Amount for today. This is just an example, what I need is a little bit more complex, but if I resolve this, I can resolve the other issues.

Sum({$<Date = {"=$(#=Now())"} >} Amt)

However, instead of show the amount for Today, it shows the total amount, ignoring the Set Analysis.

I've tried different many things like using the Date function, converting to number, etc, but they all return the same thing.

Any guess? Any idea can help.

Thanks.

7 Replies
Highlighted
Luminary
Luminary

Set Analysis with a Date field is not working properly

Use

Sum({$<Date = {"=$(=Today())"} >} Amt)

Now() returns a timestamp and not a date. Also don't use Now() unless really necessary as it will refresh every second using system resources and cause some problems for the user experience.

Regards.

Highlighted
Not applicable

Set Analysis with a Date field is not working properly

maybe because the function Now() returns a date and a time thats why its not giving you the correct result and try to check the syntax of your expression..

Highlighted
Not applicable

Set Analysis with a Date field is not working properly

Thanks guys, but I got the same results if I change to Today().

Highlighted
Not applicable

Set Analysis with a Date field is not working properly

Interesting that I just check that Today() is returning 12/30/1899

Highlighted
Not applicable

Set Analysis with a Date field is not working properly

Nevermind. I fix the Today function but I still get the same result.

Highlighted
Luminary
Luminary

Set Analysis with a Date field is not working properly

Try the following:

=sum({$<Date={"=Date=today()"}>} Sales)

I usually play with set analysis doing advanced searches over a list box of the field until it gets the result I want.

Regards.

Highlighted
Partner
Partner

Set Analysis with a Date field is not working properly

I find Set Analysis can be easier if you use a variables. So I would create a variable called vToday = date(today()). Your set expression would look like this:

=sum({$<Date={"$(#vToday)"}>} Sales)

Then if you need to use a different date in the future you can just change the variable, you don't need to change your set expression.