Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
nezuko_kamado
Creator

How can I count the number of selected days.

I have two data sets, and each has date info. One is ‘StartDate’, the other data set has  ‘PeakDate’.  Two variables have some interaction dates, but not all the same, so I created  a new date, ‘WorkingDate’, to union (U) both dates by ID.

e.g)

StartDate: March 4th, 5th, 8th,  and 10th

PeakDate: March 5th   , 9th

WorkingDate: March: 4th, 5th, 8th, 9th and 10th

 Then I want to calculate how many ‘WorkingDate’ are existing from the selected time range. I use Date Range Picker to choose date range, because I really want to visualize the date selection with a calendar.

nezuko_kamado_0-1620667831134.png

Then I choose the range from March 1st to 10th, and  ‘WorkingDate’ are only existing during 4th, 5th, 8th, 9th and 10th which causes the selection starting from 4th, not 1st.  it automatically drops first, second and the third of March from date range selection as below.

nezuko_kamado_1-1620667831145.png

 

How can I grab the time range(March first to 10th) from the calendar  in order to calculate 

nezuko_kamado_2-1620667831140.png

In other words,  how can I count the number of  selected days which will be used for a denominator, and also number of working dates for numerator.

Thank you so much!

Labels (1)
2 Replies
JustinDallas
Specialist III

Do you have any dummy data?  The crux of the issue seems like you don't have a [Working Date] for the dates you want.  I would make filler dates

 

 

nezuko_kamado
Creator
Author

Right, it's better to be explained with dummy data. So as below is dummy.

Goal is 'what % of dates we worked during the selected date range( march 1st to march 25th) '. 

Issue is that Date Range Picker automatically drops non-work date. Even though I clicked march 1st as a start date, which was not the workDate and date picker chooses  march 4th the start date.  So how can I count  march 1st to march 25th for denominator in order to calculate count(distinct(workDate)/count(selected date range) =13/25?

workDate:
load * Inline [workDate
3/4/2021
3/5/2021
3/8/2021
3/9/2021
3/10/2021
3/11/2021
3/14/2021
3/15/2021
3/16/2021
3/20/2021
3/21/2021
3/23/2021
3/24/2021
];

nezuko_kamado_0-1620848623023.png

 

Thank you!