Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

Announcements
Qlik® Product Spotlight: Discover what’s possible. Get more from our products.
See for yourself. Register today.
adambrian
Not applicable

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
Not applicable

Re: Display Date

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

8 Replies
ToniKautto
Not applicable

Re: Display Date

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)

balrajahlawat
Not applicable

Re: Display Date

try like this?

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

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

adambrian
Not applicable

Re: Display Date

Hi,

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

Thanks.

adambrian
Not applicable

Re: Display Date

Hi,

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

Thanks

MindaugasBacius
Not applicable

Re: Display Date

The balrajahlawat expression isn't about total date.

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

ToniKautto
Not applicable

Re: Display Date

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
Not applicable

Re: Display Date

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

ToniKautto
Not applicable

Re: Display Date

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