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

Showing data from today's date and 21 days forward

Hello all, 

I have built a straight table that shows the start date and end date for certain scenarios. What I am looking to accomplish is for the straight table to only show instances where the start date is either today or within the next 21 days.  I know that it will need to be built as an expression within the chart. However, I am not sure how to develop the correct expression. 

Any help would be greatly appreciated. 

Thank you,

Dylan

1 Solution

Accepted Solutions
dplr-rn
Partner - Master III
Partner - Master III

why would you sum date?

if you dont have a aggregration (sum/count ) in your table try with

Only({<OUTSTARTDATE={">=$(=today()) <=$(=today()+21)"}>} OUTSTARTDATE)

 

or keep it simple and use if statement (exclude nulls) as dimension

if(OUTSTARTDATE >=today() or  OUTSTARTDATE<=today()+21,OUTSTARTDATE)

 

View solution in original post

5 Replies
dplr-rn
Partner - Master III
Partner - Master III

use set analysis and  something like below

sum ({<StartDate={">=$(=today()) <=$(=Date(today()+21))"}>} LineSalesAmount)

so this will be date >= Jul 30th (today) and less than or equal to Aug 20

Dmichel0729
Contributor
Contributor
Author

Thank you for the assistance, however it is still showing all of the dates and not just today through 8/20

dplr-rn
Partner - Master III
Partner - Master III

2 things

1- make sure the format of your startdate field is as a date and not text. check in data model viewer it should have tag of $date,$numeric etc.

2- share your expression please

Dmichel0729
Contributor
Contributor
Author

I confirmed the format is a date and not text. 

sum ({<OUTSTARTDATE={">=$(=today()) <=$(=Date(today()+21))"}>} OUTSTARTDATE)

Where you suggested to input LineSalesAmount, I am not sure what to populate with. 

The column it is returning with the above expression gives the date 12/30/1899

dplr-rn
Partner - Master III
Partner - Master III

why would you sum date?

if you dont have a aggregration (sum/count ) in your table try with

Only({<OUTSTARTDATE={">=$(=today()) <=$(=today()+21)"}>} OUTSTARTDATE)

 

or keep it simple and use if statement (exclude nulls) as dimension

if(OUTSTARTDATE >=today() or  OUTSTARTDATE<=today()+21,OUTSTARTDATE)