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: 
lee_williams
Contributor II
Contributor II

date in a set analysis

Hi,

Can anyone give any clue or syntax around why this quite simple set analysis expression doesn't work.

I have a table which updates daily and shows the position

 

DateSM
2018-02-101032
2018-02-111133
2018-02-121334
2018-02-131432
2018-02-141631

2018-02-15

1736

so I'm just trying to create a formula for a text box which pulls out the correct amount for that day

I'm using a variable to define the current date

vCurrentDay = Date(today(),'YYYY-MM-DD')             as I noticed that having it in normal date format  DD/MM/YYYY it didn't  match with the Date field I formatted date to match date field  'YYYY-MM-DD'

the expression

=sum({< Date={"2018-02-08"}>}M)    works fine

=sum({< Date={"=date#(today(),'YYYY-MM-DD')"}>}M) - fails returns 198  (which is the sum of the entire column)

=sum({< Date={"=date(today(),'YYYY-MM-DD')"}>}M)   - fails - return 0

and so expression used

=sum({< Date={"=$(vCurrentDay)"}>}M)   - fails - return  198 (which is the sum of the entire column)

=sum({< Date={"$(vCurrentDay)"}>}M)   - fails returns 0

I've tried upteen variations of the expression - all to no avail.

any help please?

1 Solution

Accepted Solutions
sunny_talwar

Try this

=Sum({< Date={"$(=Date(Today(), 'YYYY-MM-DD'))"}>}M)

View solution in original post

2 Replies
sunny_talwar

Try this

=Sum({< Date={"$(=Date(Today(), 'YYYY-MM-DD'))"}>}M)

lee_williams
Contributor II
Contributor II
Author

Many thanks