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
Did you mean:
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.

 Date TUTStatus 5/17/2020 Completed 5/20/2020 Completed 5/23/2020 Completed 5/25/2020 Completed 5/28/2020 Completed

Thanks

Chris

Labels (3)

• @sunnytalwar

6 Replies
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
Partner
Author

Modified Sample data a bit to show the bar chart.

Sample Data

 Object Date FUT Status Count Object1 5/16/2020 Completed Object2 5/17/2020 Completed Object3 5/20/2020 Completed Object4 5/23/2020 Completed Object5 5/24/2020 Completed Object6 5/24/2020 Completed Object7 5/24/2020 Completed Object8 5/24/2020 Completed Object9 5/25/2020 Completed 9 Object10 5/27/2020 Completed Object11 5/27/2020 Completed Object12 5/27/2020 Completed 12

Attached Expected Bar chart

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

Thanks

Partner

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
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.

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
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.

 Object Date FUT Status Object1 5/16/2020 Completed Object2 5/17/2020 Completed Object4 5/17/2020 Not Completed Object3 5/20/2020 Completed Object4 5/23/2020 Completed Object5 5/24/2020 Completed Object6 5/24/2020 Completed Object7 5/24/2020 Completed Object8 5/24/2020 Completed Object9 5/25/2020 Completed Object10 5/27/2020 Completed Object11 5/27/2020 Completed Object12 5/27/2020 Completed