Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
NewUser1
Contributor II
Contributor II

How to show only yesterday's value in KPI

Dear Experts, 

My Dimension : 'ProdnDate' has data in the format as 2019-01-30.

My Measure : Duration

How do i show only yesterday's duration in a KPI?

Thank you and regards.

Labels (3)
3 Replies
lblumenfeld
Partner Ambassador
Partner Ambassador

This expression should work. You may have to adjust the function (I'm assuming you want the Sum) or the date format.

Sum({<ProdnDate={"=$(=date(today()-1,'YYYY/MM/DD'))"}>} Sales)

 

I hope this helps.

Vegar
MVP
MVP

@lblumenfeld 

It looks like your suggestion will include all dates larger than yesterday.

Sum({<ProdnDate={">=$(=date(today()-1,'YYYY/MM/DD'))"}>} Sales)

If you only want yesterday's value you can adjust to an expression similar to this. 

Sum({<ProdnDate={"=$(=date(today()-1))"}>} Sales)

lblumenfeld
Partner Ambassador
Partner Ambassador

Oops. Forgot to remove the >  from the example I pasted. I've corrected mine above. Thanks @Vegar . I'd leave the date format in though.