Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Dear Experts,
I want to show last 7 or 10 days activity counts in bar chart(date wise)
How it is possible ? date format is as below -
28/12/2019 12:03:00 PM
Thanks in advance.
Could you share a sample set of your data and explain expected output format against that?
How you will found which are active days? What is the logic behind to do
By default it should be last 7 days like if I open the dashboard then data should be reflect for below dates -
02/01/2020
31/12/2019
30/12/2019
29/12/2019
28/12/2019
27/12/2019
26/12/2019
If I filter with any month, like if i filter Nov month for 2019 then data should be reflect for last 7 days for Nov 2019 month.
24 Nov 2019 to 30 Nov 2019.
Attaching the dummy data also.
Create a new field (say, [Activity Start Time DATE]) in the script using date(floor(.. and use the same field in the chart as dimension and expression like:
Count({<[Activity Start Time DATE]={">=$(=Date(Max([Activity Start Time DATE],7)))"}>}[Activity Start Time])
Created new columns with below formula -
date(Floor([Activity Start Time]),'DD/MM/YYYY') as chartdate
then using below in bar chart dimention -
Count({<chartdate={">=$(=Date(Max(chartdate,7)))"}>}chartdate)
but error message is coming that "Invalid Dimention"
Perhaps your date field is not being recognized as date but string. Try modifying your timestamp system variable in script to match your date field format and reload or use date#() to convert string to date inside floor().
See attached
A couple of things: as Tresesco has said, make sure your date field are loaded correctly as date/timestamp; create two expressions which you will switch between when a month is selected
Hi Lorenzo,
Thanks, this is what exactly I wanted, but how can I put this in bar or line chart.
I have tried and just changed chart type in your data it but it is not coming correctly -
Attached
Lorenzo