Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Set analysis: sum if date before today

Hello everyone,

I'm trying to create a misure based on the current date. I'd like to sum the differences between two dates, based on the finish date that must be not after today.

So, I'd like to achieve something like:

SUM({<FinishDate <= {Today()}>}               INTERVAL(Finishdate - StartDate, 'd'))

Obviously the formula is wrong, how could I achieve that?

Many thanks

1 Solution

Accepted Solutions
m_woolf
Master II
Master II

Maybe:

SUM({<FinishDate = {"<=$(=Today())"}>}              INTERVAL(Finishdate - StartDate, 'd'))

View solution in original post

4 Replies
OmarBenSalem

Just create a table:

as dimension:

StartDate

as measure:

today(1)-StartDate

or maybe:

if(FinishDate>today(1),today(1)-StartDate,FinishDate-StartDate)

example:

Capture.PNG

m_woolf
Master II
Master II

Maybe:

SUM({<FinishDate = {"<=$(=Today())"}>}              INTERVAL(Finishdate - StartDate, 'd'))

sasiparupudi1
Master III
Master III

SUM({<FinishDate = {'<=$(=Today())'}>}INTERVAL(Finishdate - StartDate, 'd'))

Anonymous
Not applicable
Author

That's exactly that I wanted, many thanks!

I guess I have now understood how it works with > and < comparison...!