Qlik Community

Ask a Question

New to Qlik Sense

If you’re new to Qlik Sense, start with this Discussion Board and get up-to-speed quickly.

Announcements
Become an analytics expert with Qlik's new 15 week course: Applied Data Analytics using Qlik Sense. READ MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Chris272727
Partner
Partner

Get Last few days dynamically in Bar chart

Hello Everyone,

Below is my Sample Data. I would like to show last 3 days dynamically in a chart and cumulative sum of TUTStatus which i can get it. I am able to show last 3 days if dates are continuous. 

DateTUTStatus
5/17/2020Completed
5/20/2020Completed
5/23/2020Completed
5/25/2020Completed
5/28/2020Completed

 

Thanks

Chris

Labels (3)
6 Replies
Vegar
Partner
Partner

What is the expected result for your sample data? Could you explain? Maybe post a picture of a mockup bar chart?

Plees ekskuse my Swenglish and or Norweglish spelling misstakes
Chris272727
Partner
Partner
Author

Modified Sample data a bit to show the bar chart.

Sample Data

Object

Date

FUT StatusCount
Object15/16/2020Completed 
Object25/17/2020Completed 
Object35/20/2020Completed 
Object45/23/2020Completed 
Object55/24/2020Completed 
Object65/24/2020Completed 
Object75/24/2020Completed 
Object85/24/2020Completed 
Object95/25/2020Completed9
Object105/27/2020Completed 
Object115/27/2020Completed 
Object125/27/2020Completed12

 

Attached Expected Bar chart

Expectation is to get last two or few days dynamically. Like Top 2 or 5 numbers.

 
 

Thanks

 

 

Vegar
Partner
Partner

Vegar_0-1591698547845.png

Try an expression like this:

Sum({<Date = {">$(=max(Date)-3) <=$(=max(Date))"}>}Count)

See attached qvf for an working example.

Plees ekskuse my Swenglish and or Norweglish spelling misstakes
Chris272727
Partner
Partner
Author

Thanks for the reply but i think it is still bit off.

I am expecting to see 5/24/2020 also in the bar chart but with below expression its not showing up

Sum({<Date = {">$(=max(Date)-3) <=$(=max(Date))"}>}Count). This expression would show last 3 days i.e 5/27/2020, 5/26/2020 and 5/25/2020.

Since we dont have 5/26/2020 in the data set, I expect 5/24/2020 to appear in the chart. I hope its clear now.

Chris272727_0-1591720815132.png

 

Vegar
Partner
Partner

You want to display the 3 latest registrated days? If so then try something like this:

Sum({<Date = {">=$(=max(Date, 3)) <=$(=max(Date))"}>}Count)

Plees ekskuse my Swenglish and or Norweglish spelling misstakes
Chris272727
Partner
Partner
Author

Thanks for the reply. There is no Count field in the data set. Just added to explain the requirement.

Key Dimension is TUTSTatus who status is completed.

Requirement is to display last 3 registrated day who TUTStatus is completed.

ObjectDateFUT Status
Object15/16/2020Completed
Object25/17/2020Completed
Object45/17/2020Not Completed
Object35/20/2020Completed
Object45/23/2020Completed
Object55/24/2020Completed
Object65/24/2020Completed
Object75/24/2020Completed
Object85/24/2020Completed
Object95/25/2020Completed
Object105/27/2020Completed
Object115/27/2020Completed
Object125/27/2020Completed