Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
adambrian
Contributor III
Contributor III

Display Date

Hi,

I want to display date just from yesterday until today only.  I tried  this expression date(today()-1>today()). Can you help me for this expression.

Thank You,

Adam

1 Solution

Accepted Solutions
ToniKautto
Employee
Employee

Take a look at this updated app. It has a few different approaches to filter the data based on today and yesterday.

View solution in original post

8 Replies
ToniKautto
Employee
Employee

In what context do you want to display the dates? Is it in a filter pane, chart or table?

Generally I would suggest adding a flag in your data model to identify the rows related to the desired time period. For example in this case it could be inline with;

If(MyDate = Today()-1 OR MyDate = Today(), 1, 0) AS MyDateTodayOrYesterday

In your visualizations you can then use a set expression to target aggregations to the flagged rows.

Sum({<MyDateTodayOrYesterday={1}>} AnOtherField)

For displaying the same dates as one value you can concatenate the values

Concat({<MyDateTodayOrYesterday={1}>} MyDate)


Without the flag in data model the set expression would be


Concat({<MyDate={">=$(=Date(Today()-1))<=$(=Today())"}>} MyDate)

Anonymous
Not applicable

try like this?

=sum({<Date={'>=(=date(today()-1))<=(=date(today()))'}>} sales)

Make sure Format of all date fields should be same!!

adambrian
Contributor III
Contributor III
Author

Hi,

I used table. I just want to display all event from yesterday until today in table.

Thanks.

adambrian
Contributor III
Contributor III
Author

Hi,

I don't want total date, i just want display event what happening from yesterday until today.

Thanks

MindaugasBacius
Partner - Specialist III
Partner - Specialist III

The balrajahlawat expression isn't about total date.

The product of the expression will be the total sales of today and yesterday.

ToniKautto
Employee
Employee

Output from Today() is already formatted, so it does not require the Date() format.

Today()-1 generates a number, so that part must be formatted.

adambrian
Contributor III
Contributor III
Author

sorry for my misunderstanding.. I guess i got hint from that expression.. Thank you for your explaination.

ToniKautto
Employee
Employee

Take a look at this updated app. It has a few different approaches to filter the data based on today and yesterday.