Changing structure of a dataframe - pandas

I have five dataframes which have same indexes and columns, I mean all of them have same size.
These dataframes are Fixed_Cost, Variable_Cost, Semi_Variable_Cost, Marginal_Cost and Total_Cost. I want to change all dataframes in the same way.
This is Fixed_Cost:
date A B
2019-01-31 00:00:00 31,58 7,16
2019-02-28 00:00:00 17,11 12,30
2019-03-31 00:00:00 16,28 9,28
2019-04-30 00:00:00 23,63 18,31
2019-05-31 00:00:00 35,10 28,64
2019-06-30 00:00:00 34,50 20,34
2019-07-31 00:00:00 22,21 13,66
2019-08-31 00:00:00 19,91 7,15
2019-09-30 00:00:00 15,48 6,63
2019-10-31 00:00:00 18,06 10,19
2019-11-30 00:00:00 26,73 11,69
2019-12-31 00:00:00 36,69 11,15
2020-01-31 00:00:00 22,67 6,32
2020-02-29 00:00:00 24,12 10,72
2020-03-31 00:00:00 39,43 18,01
I want to change its structure to this:
Year Month Name Fixed_Cost
2019 1 A 31,58
2019 2 A 17,11
2019 3 A 16,28
2019 4 A 23,63
2019 5 A 35,10
2019 6 A 34,50
2019 7 A .
2019 8 A .
2019 9 A .
2019 10 A
2019 11 A
2019 12 A
2020 1 A
2020 2 A
2020 3 A
2019 1 B
2019 2 B
2019 3 B
2019 4 B
2019 5 B
2019 6 B
2019 7 B
2019 8 B
2019 9 B
2019 10 B
2019 11 B
2019 12 B
2020 1 B 6,32
2020 2 B 10,72
2020 3 B 18,01
Is it possible to make this change?

IIUC, assuming you want the data values filled out we can use assign and melt
#covert to datetime first.
#df['date'] = pd.to_datetime(df['date'])
df2 = (df.assign(year=(df['date'].dt.year)).assign(month=(df['date'].dt.month))
.drop('date',axis=1)
.melt(id_vars=['year','month'],var_name='name',value_name='fixed cost'))
print(df2)
year month name fixed cost
0 2019 1 A 31,58
1 2019 2 A 17,11
2 2019 3 A 16,28
3 2019 4 A 23,63
4 2019 5 A 35,10
5 2019 6 A 34,50
6 2019 7 A 22,21
7 2019 8 A 19,91
8 2019 9 A 15,48
9 2019 10 A 18,06
10 2019 11 A 26,73
11 2019 12 A 36,69
12 2020 1 A 22,67
13 2020 2 A 24,12
14 2020 3 A 39,43
15 2019 1 B 7,16
16 2019 2 B 12,30
17 2019 3 B 9,28
18 2019 4 B 18,31
19 2019 5 B 28,64
20 2019 6 B 20,34
21 2019 7 B 13,66
22 2019 8 B 7,15
23 2019 9 B 6,63
24 2019 10 B 10,19
25 2019 11 B 11,69
26 2019 12 B 11,15
27 2020 1 B 6,32
28 2020 2 B 10,72
29 2020 3 B 18,01

Approach for this is to use melt.
pd.melt(df, id_vars=['date'], var_name='description')
date description value
0 2019-01-31 A 3158
1 2019-02-28 A 233
2 2019-03-31 A 534
3 2019-01-31 B 12
4 2019-02-28 B 435
5 2019-03-31 B 64545
Then create new columns for Year and Month

Related

Daily calculations in intraday data

Let's say I have a DataFrame with date_time index:
date_time a b
2020-11-23 04:00:00 10 5
2020-11-23 05:00:00 11 5
2020-11-23 06:00:00 12 5
2020-11-24 04:30:00 13 6
2020-11-24 05:30:00 14 6
2020-11-24 06:30:00 15 6
2020-11-25 06:00:00 16 7
2020-11-25 07:00:00 17 7
2020-11-25 08:00:00 18 7
"a" column is intraday data (every row - different value). "b" column - DAILY data - same data during the current day.
I need to make some calculations with "b" (daily) column and create "c" column with the result. For example, sum for two last days.
Result:
date_time a b c
2020-11-23 04:00:00 10 5 NaN
2020-11-23 05:00:00 11 5 NaN
2020-11-23 06:00:00 12 5 NaN
2020-11-24 04:30:00 13 6 11
2020-11-24 05:30:00 14 6 11
2020-11-24 06:30:00 15 6 11
2020-11-25 06:00:00 16 7 13
2020-11-25 07:00:00 17 7 13
2020-11-25 08:00:00 18 7 13
I guesss I should use something like
df['c'] = df.resample('D').b.rolling(3).sum ...
but I got "NaN" values in "c".
Could you help me? Thanks!
One thing you can do is to drop duplicates on the date and work on that:
# get the dates
df['date'] = df['date_time'].dt.normalize()
df['c'] = (df.drop_duplicates('date')['b'] # drop duplicates on dates
.rolling(2).sum() # rolling sum
)
df['c'] = df['c'].ffill() # fill the missing data
Output:
date_time a b date c
0 2020-11-23 04:00:00 10 5 2020-11-23 NaN
1 2020-11-23 05:00:00 11 5 2020-11-23 NaN
2 2020-11-23 06:00:00 12 5 2020-11-23 NaN
3 2020-11-24 04:30:00 13 6 2020-11-24 11.0
4 2020-11-24 05:30:00 14 6 2020-11-24 11.0
5 2020-11-24 06:30:00 15 6 2020-11-24 11.0
6 2020-11-25 06:00:00 16 7 2020-11-25 13.0
7 2020-11-25 07:00:00 17 7 2020-11-25 13.0
8 2020-11-25 08:00:00 18 7 2020-11-25 13.0

Select from two dates, automatically displaying consecutive rows data

I expect to select from two date, automatically displaying consecutive time rows data.
e.g:
Select *
from somefunction('2013/5','2019/3');
Expected result:
Year | Month
-----+------
2013 | 5
2013 | 6
.. | ..
2013 | 12
.. | ..
.. | ..
2019 | 1
2019 | 2
2019 | 3
I have solved the problem, and the solution is provided here .
declare #dStart datetime = '2013/05/01'
,#dEnd datetime = '2019/03/31';
SELECT year(Dateadd(month,number,#dStart)) as year,month(Dateadd(month,number,#dStart)) as month
FROM master..spt_values
WHERE
type = 'P'
AND number <= DATEDIFF(month, #dStart, #dEnd)
GO
year | month
---: | ----:
2013 | 5
2013 | 6
2013 | 7
2013 | 8
2013 | 9
2013 | 10
2013 | 11
2013 | 12
2014 | 1
2014 | 2
2014 | 3
2014 | 4
2014 | 5
2014 | 6
2014 | 7
2014 | 8
2014 | 9
2014 | 10
2014 | 11
2014 | 12
2015 | 1
2015 | 2
2015 | 3
2015 | 4
2015 | 5
2015 | 6
2015 | 7
2015 | 8
2015 | 9
2015 | 10
2015 | 11
2015 | 12
2016 | 1
2016 | 2
2016 | 3
2016 | 4
2016 | 5
2016 | 6
2016 | 7
2016 | 8
2016 | 9
2016 | 10
2016 | 11
2016 | 12
2017 | 1
2017 | 2
2017 | 3
2017 | 4
2017 | 5
2017 | 6
2017 | 7
2017 | 8
2017 | 9
2017 | 10
2017 | 11
2017 | 12
2018 | 1
2018 | 2
2018 | 3
2018 | 4
2018 | 5
2018 | 6
2018 | 7
2018 | 8
2018 | 9
2018 | 10
2018 | 11
2018 | 12
2019 | 1
2019 | 2
2019 | 3
db<>fiddle here

SQL replace incomplete days of the week in the month to 0

I have this table
date week_day
1-02-2018 4
2-02-2018 5
3-02-2018 6
4-02-2018 7
5-02-2018 1
6-02-2018 2
7-02-2018 3
................
26-02-2018 1
27-02-2018 2
28-02-2018 3
I need to get in SQL incomplete weeks to next in the following form:
date week_day
0 1
0 2
0 3
1-02-2018 4
2-02-2018 5
3-02-2018 6
4-02-2018 7
5-02-2018 1
6-02-2018 2
7-02-2018 3
................
26-02-2018 1
27-02-2018 2
28-02-2018 3
0 4
0 5
0 6
0 7
Is something like this what you're looking for:
DECLARE #FirstDate date =
(
SELECT MIN(DATEADD(DAY, (week_day - 1) * -1, [date]))
FROM YourTable
)
DECLARE #LastDate date =
(
SELECT MAX(DATEADD(DAY, 7 - week_day, [date]))
FROM YourTable
)
;
WITH cteDates
AS
(
SELECT
#FirstDate [date]
, 1 week_day
UNION ALL
SELECT
DATEADD(DAY, 1, [date])
, CASE WHEN week_day + 1 > 7 THEN 1 ELSE week_day + 1 END
FROM cteDates
WHERE [date] < #LastDate
)
SELECT
T.[date]
, C.week_day
FROM
cteDates C
LEFT JOIN YourTable T ON
C.[date] = T.[date]
AND C.week_day = T.week_day
This query seems to solve your query. I assume that your minimal date is over 1900-01-01. If not put any other date that is under than your minimal date and is monday
Also there may be better solution with recursive cte
with cte as (
select cast(a as datetime) date, b week_day from (values ('20180201',4)
,('20180202',5)
,('20180203',6)
,('20180204',7)
,('20180205',1)
,('20180206',2)
,('20180207',3)
,('20180226',1)
,('20180227',2)
,('20180228',3)
,('20181231',1)
,('20190101',2)
,('20190102',3)
,('20190103',4)
,('20190104',5)
) t(a,b)
)
select
iif((rn = 1 and charindex(k, st) > 0) or k is null, convert(varchar(10), date, 120), '0')
, isnull(k, week_day)
from (
select
date, week_day, ww
, concat(max(iif(week_day = 1, 1, null)) over (partition by ww)
, max(iif(week_day = 2, 2, null)) over (partition by ww)
, max(iif(week_day = 3, 3, null)) over (partition by ww)
, max(iif(week_day = 4, 4, null)) over (partition by ww)
, max(iif(week_day = 5, 5, null)) over (partition by ww)
, max(iif(week_day = 6, 6, null)) over (partition by ww)
, max(iif(week_day = 7, 7, null)) over (partition by ww)) st
, row_number() over (partition by ww order by week_day) rn
from
cte
cross apply (select datediff(dd, cast('19000101' as datetime), date) / 7 ww) q
) t
left join (values ('1'),('2'),('3'),('4'),('5'),('6'),('7')) z(k)
on
rn = 1
and (charindex(k, st) = 0 or iif(rn = 1, week_day, 0) = k)
The main key is to get the cartesian join of the (year, month, week) and weekdays then do a left join on the dates in question. The second key is to adjust for Monday being to the start of the week.
Here is an example that works in MySQL. It has one edge case which I have not yet resolved. The case of a month's last day ending on a Sunday. In that case, there are 7 zeros between the end of that month and the start of the next.
select * from (
select cartesian.`year`
, cartesian.`month`
, cartesian.`week`
, coalesce(dates.`date`,0) `date`, cartesian.weekday+1 week_day from (
/* get distinct cartesian results for the (year, month, week) and weekday */
select `year`
, `month`
, case weekday when 6 then `week` - 1 else `week` end `week`
, weekday
from (
select distinct year(`date`) `year`
, month(`date`) `month`
, week(`date`) `week`
, weeks.weekday
from date_48361641, (
select 0 weekday union
select 1 weekday union
select 2 weekday union
select 3 weekday union
select 4 weekday union
select 5 weekday union
select 6 weekday
) weeks
) weeks
-- order by `year`, `month`, `week`, `weekday`
) cartesian
left join (
/* adjust for edge case of week 0 */
select `date`
, `year`
, `month`
, `week`
, weekday
from (
/* adjust the week to allow for Monday start of week*/
select `date`
, `year`
, `month`
, case weekday when 6 then `week` - 1 else `week` end `week`
, weekday
from (
select `date`
, year(`date`) `year`
, month(`date`) `month`
, week(`date`) `week`
, weekday(`date`) weekday
from date_48361641 dates
-- order by `date`
) dates
) dates
) dates
on dates.`year` = cartesian.`year`
and dates.`month` = cartesian.`month`
and dates.`week` = cartesian.`week`
and dates.`weekday` = cartesian.`weekday`
) results
where results.`week` > -1
order by
results.`year`
, results.`month`
, results.`week`
, results.`week_day`
-- results
year month week date week_day
2016 1 0 0 1
2016 1 0 0 2
2016 1 0 0 3
2016 1 0 0 4
2016 1 0 2016-01-01 5
2016 1 0 2016-01-02 6
2016 1 0 2016-01-03 7
...
2016 1 4 2016-01-25 1
2016 1 4 2016-01-26 2
2016 1 4 2016-01-27 3
2016 1 4 2016-01-28 4
2016 1 4 2016-01-29 5
2016 1 4 2016-01-30 6
2016 1 4 2016-01-31 7
2016 1 5 0 1
2016 1 5 0 2
2016 1 5 0 3
2016 1 5 0 4
2016 1 5 0 5
2016 1 5 0 6
2016 2 4 0 7
2016 2 5 2016-02-01 1
2016 2 5 2016-02-02 2
2016 2 5 2016-02-03 3
2016 2 5 2016-02-04 4
2016 2 5 2016-02-05 5
2016 2 5 2016-02-06 6
2016 2 5 2016-02-07 7
...
2016 2 9 2016-02-29 1
2016 2 9 0 2
2016 2 9 0 3
2016 2 9 0 4
2016 2 9 0 5
2016 2 9 0 6
2016 3 8 0 7
2016 3 9 0 1
2016 3 9 2016-03-01 2
2016 3 9 2016-03-02 3
2016 3 9 2016-03-03 4
2016 3 9 2016-03-04 5
2016 3 9 2016-03-05 6
2016 3 9 2016-03-06 7
...
2016 3 13 2016-03-28 1
2016 3 13 2016-03-29 2
2016 3 13 2016-03-30 3
2016 3 13 2016-03-31 4
2016 3 13 0 5
2016 3 13 0 6
2016 4 12 0 7
2016 4 13 0 1
2016 4 13 0 2
2016 4 13 0 3
2016 4 13 0 4
2016 4 13 2016-04-01 5
2016 4 13 2016-04-02 6
2016 4 13 2016-04-03 7
...
2016 5 22 2016-05-30 1
2016 5 22 2016-05-31 2
2016 5 22 0 3
2016 5 22 0 4
2016 5 22 0 5
2016 5 22 0 6
2016 6 21 0 7
2016 6 22 0 1
2016 6 22 0 2
2016 6 22 2016-06-01 3
2016 6 22 2016-06-02 4
2016 6 22 2016-06-03 5
2016 6 22 2016-06-04 6
2016 6 22 2016-06-05 7
...
2016 6 26 2016-06-27 1
2016 6 26 2016-06-28 2
2016 6 26 2016-06-29 3
2016 6 26 2016-06-30 4
2016 6 26 0 5
2016 6 26 0 6
2016 7 25 0 7
2016 7 26 0 1
2016 7 26 0 2
2016 7 26 0 3
2016 7 26 0 4
2016 7 26 2016-07-01 5
2016 7 26 2016-07-02 6
2016 7 26 2016-07-03 7
...
2016 7 30 2016-07-25 1
2016 7 30 2016-07-26 2
2016 7 30 2016-07-27 3
2016 7 30 2016-07-28 4
2016 7 30 2016-07-29 5
2016 7 30 2016-07-30 6
2016 7 30 2016-07-31 7
2016 7 31 0 1
2016 7 31 0 2
2016 7 31 0 3
2016 7 31 0 4
2016 7 31 0 5
2016 7 31 0 6
2016 8 30 0 7
2016 8 31 2016-08-01 1
2016 8 31 2016-08-02 2
2016 8 31 2016-08-03 3
2016 8 31 2016-08-04 4
2016 8 31 2016-08-05 5
2016 8 31 2016-08-06 6
2016 8 31 2016-08-07 7
...
2016 8 35 2016-08-29 1
2016 8 35 2016-08-30 2
2016 8 35 2016-08-31 3
2016 8 35 0 4
2016 8 35 0 5
2016 8 35 0 6
2016 9 34 0 7
2016 9 35 0 1
2016 9 35 0 2
2016 9 35 0 3
2016 9 35 2016-09-01 4
2016 9 35 2016-09-02 5
2016 9 35 2016-09-03 6
2016 9 35 2016-09-04 7
...
2016 9 39 2016-09-26 1
2016 9 39 2016-09-27 2
2016 9 39 2016-09-28 3
2016 9 39 2016-09-29 4
2016 9 39 2016-09-30 5
2016 9 39 0 6
2016 10 38 0 7
2016 10 39 0 1
2016 10 39 0 2
2016 10 39 0 3
2016 10 39 0 4
2016 10 39 0 5
2016 10 39 2016-10-01 6
2016 10 39 2016-10-02 7
...
2016 10 44 2016-10-31 1
2016 10 44 0 2
2016 10 44 0 3
2016 10 44 0 4
2016 10 44 0 5
2016 10 44 0 6
2016 11 43 0 7
2016 11 44 0 1
2016 11 44 2016-11-01 2
2016 11 44 2016-11-02 3
2016 11 44 2016-11-03 4
2016 11 44 2016-11-04 5
2016 11 44 2016-11-05 6
2016 11 44 2016-11-06 7
...
2016 11 48 2016-11-28 1
2016 11 48 2016-11-29 2
2016 11 48 2016-11-30 3
2016 11 48 0 4
2016 11 48 0 5
2016 11 48 0 6
2016 12 47 0 7
2016 12 48 0 1
2016 12 48 0 2
2016 12 48 0 3
2016 12 48 2016-12-01 4
2016 12 48 2016-12-02 5
2016 12 48 2016-12-03 6
2016 12 48 2016-12-04 7
2016 12 49 2016-12-05 1
2016 12 49 2016-12-06 2
2016 12 49 2016-12-07 3
2016 12 49 2016-12-08 4
2016 12 49 2016-12-09 5
2016 12 49 2016-12-10 6
2016 12 49 2016-12-11 7
2016 12 50 2016-12-12 1
2016 12 50 2016-12-13 2
2016 12 50 2016-12-14 3
2016 12 50 2016-12-15 4
2016 12 50 2016-12-16 5
2016 12 50 2016-12-17 6
2016 12 50 2016-12-18 7
2016 12 51 2016-12-19 1
2016 12 51 2016-12-20 2
2016 12 51 2016-12-21 3
2016 12 51 2016-12-22 4
2016 12 51 2016-12-23 5
2016 12 51 2016-12-24 6
2016 12 51 2016-12-25 7
2016 12 52 2016-12-26 1
2016 12 52 2016-12-27 2
2016 12 52 2016-12-28 3
2016 12 52 2016-12-29 4
2016 12 52 2016-12-30 5
2016 12 52 2016-12-31 6
2017 1 0 2017-01-01 7
2017 1 1 2017-01-02 1
2017 1 1 2017-01-03 2
2017 1 1 2017-01-04 3
2017 1 1 2017-01-05 4
2017 1 1 2017-01-06 5
2017 1 1 2017-01-07 6
2017 1 1 2017-01-08 7
2017 1 2 2017-01-09 1
2017 1 2 2017-01-10 2
2017 1 2 2017-01-11 3
2017 1 2 2017-01-12 4
2017 1 2 2017-01-13 5
2017 1 2 2017-01-14 6
2017 1 2 2017-01-15 7
2017 1 3 2017-01-16 1
2017 1 3 2017-01-17 2
2017 1 3 2017-01-18 3
2017 1 3 2017-01-19 4
2017 1 3 2017-01-20 5
2017 1 3 2017-01-21 6
2017 1 3 2017-01-22 7
2017 1 4 2017-01-23 1
2017 1 4 2017-01-24 2
2017 1 4 2017-01-25 3
2017 1 4 2017-01-26 4
2017 1 4 2017-01-27 5
2017 1 4 2017-01-28 6
2017 1 4 2017-01-29 7
2017 1 5 2017-01-30 1
2017 1 5 2017-01-31 2
2017 1 5 0 3
2017 1 5 0 4
2017 1 5 0 5
2017 1 5 0 6
2017 2 4 0 7
2017 2 5 0 1
2017 2 5 0 2
2017 2 5 2017-02-01 3
2017 2 5 2017-02-02 4
2017 2 5 2017-02-03 5
2017 2 5 2017-02-04 6
2017 2 5 2017-02-05 7
2017 2 6 2017-02-06 1
2017 2 6 2017-02-07 2
2017 2 6 2017-02-08 3
2017 2 6 2017-02-09 4
2017 2 6 2017-02-10 5
2017 2 6 2017-02-11 6
2017 2 6 2017-02-12 7
2017 2 7 2017-02-13 1
2017 2 7 2017-02-14 2
2017 2 7 2017-02-15 3
2017 2 7 2017-02-16 4
2017 2 7 2017-02-17 5
2017 2 7 2017-02-18 6
2017 2 7 2017-02-19 7
2017 2 8 2017-02-20 1
2017 2 8 2017-02-21 2
2017 2 8 2017-02-22 3
2017 2 8 2017-02-23 4
2017 2 8 2017-02-24 5
2017 2 8 2017-02-25 6
2017 2 8 2017-02-26 7
2017 2 9 2017-02-27 1
2017 2 9 2017-02-28 2
2017 2 9 0 3
2017 2 9 0 4
2017 2 9 0 5
2017 2 9 0 6
2017 3 8 0 7
2017 3 9 0 1
2017 3 9 0 2
2017 3 9 2017-03-01 3
2017 3 9 2017-03-02 4
2017 3 9 2017-03-03 5
2017 3 9 2017-03-04 6
2017 3 9 2017-03-05 7
2017 3 10 2017-03-06 1
2017 3 10 2017-03-07 2
2017 3 10 2017-03-08 3
2017 3 10 2017-03-09 4
2017 3 10 2017-03-10 5
2017 3 10 2017-03-11 6
2017 3 10 2017-03-12 7
2017 3 11 2017-03-13 1
2017 3 11 2017-03-14 2
2017 3 11 2017-03-15 3
2017 3 11 2017-03-16 4
2017 3 11 2017-03-17 5
2017 3 11 2017-03-18 6
2017 3 11 2017-03-19 7
2017 3 12 2017-03-20 1
2017 3 12 2017-03-21 2
2017 3 12 2017-03-22 3
2017 3 12 2017-03-23 4
2017 3 12 2017-03-24 5
2017 3 12 2017-03-25 6
2017 3 12 2017-03-26 7
2017 3 13 2017-03-27 1
2017 3 13 2017-03-28 2
2017 3 13 2017-03-29 3
2017 3 13 2017-03-30 4
2017 3 13 2017-03-31 5
2017 3 13 0 6
2017 4 12 0 7
2017 4 13 0 1
2017 4 13 0 2
2017 4 13 0 3
2017 4 13 0 4
2017 4 13 0 5
2017 4 13 2017-04-01 6
2017 4 13 2017-04-02 7
2017 4 14 2017-04-03 1
2017 4 14 2017-04-04 2
2017 4 14 2017-04-05 3
2017 4 14 2017-04-06 4
2017 4 14 2017-04-07 5
2017 4 14 2017-04-08 6
2017 4 14 2017-04-09 7
2017 4 15 2017-04-10 1
2017 4 15 2017-04-11 2
2017 4 15 2017-04-12 3
2017 4 15 2017-04-13 4
2017 4 15 2017-04-14 5
2017 4 15 2017-04-15 6
2017 4 15 2017-04-16 7
2017 4 16 2017-04-17 1
2017 4 16 2017-04-18 2
2017 4 16 2017-04-19 3
2017 4 16 2017-04-20 4
2017 4 16 2017-04-21 5
2017 4 16 2017-04-22 6
2017 4 16 2017-04-23 7
2017 4 17 2017-04-24 1
2017 4 17 2017-04-25 2
2017 4 17 2017-04-26 3
2017 4 17 2017-04-27 4
2017 4 17 2017-04-28 5
2017 4 17 2017-04-29 6
2017 4 17 2017-04-30 7
2017 4 18 0 1
2017 4 18 0 2
2017 4 18 0 3
2017 4 18 0 4
2017 4 18 0 5
2017 4 18 0 6
2017 5 17 0 7
2017 5 18 2017-05-01 1
2017 5 18 2017-05-02 2
2017 5 18 2017-05-03 3
2017 5 18 2017-05-04 4
2017 5 18 2017-05-05 5
2017 5 18 2017-05-06 6
2017 5 18 2017-05-07 7
2017 5 19 2017-05-08 1
2017 5 19 2017-05-09 2
2017 5 19 2017-05-10 3
2017 5 19 2017-05-11 4
2017 5 19 2017-05-12 5
2017 5 19 2017-05-13 6
2017 5 19 2017-05-14 7
2017 5 20 2017-05-15 1
2017 5 20 2017-05-16 2
2017 5 20 2017-05-17 3
2017 5 20 2017-05-18 4
2017 5 20 2017-05-19 5
2017 5 20 2017-05-20 6
2017 5 20 2017-05-21 7
2017 5 21 2017-05-22 1
2017 5 21 2017-05-23 2
2017 5 21 2017-05-24 3
2017 5 21 2017-05-25 4
2017 5 21 2017-05-26 5
2017 5 21 2017-05-27 6
2017 5 21 2017-05-28 7
2017 5 22 2017-05-29 1
2017 5 22 2017-05-30 2
2017 5 22 2017-05-31 3
2017 5 22 0 4
2017 5 22 0 5
2017 5 22 0 6
2017 6 21 0 7
2017 6 22 0 1
2017 6 22 0 2
2017 6 22 0 3
2017 6 22 2017-06-01 4
2017 6 22 2017-06-02 5
2017 6 22 2017-06-03 6
2017 6 22 2017-06-04 7
2017 6 23 2017-06-05 1
2017 6 23 2017-06-06 2
2017 6 23 2017-06-07 3
2017 6 23 2017-06-08 4
2017 6 23 2017-06-09 5
2017 6 23 2017-06-10 6
2017 6 23 2017-06-11 7
2017 6 24 2017-06-12 1
2017 6 24 2017-06-13 2
2017 6 24 2017-06-14 3
2017 6 24 2017-06-15 4
2017 6 24 2017-06-16 5
2017 6 24 2017-06-17 6
2017 6 24 2017-06-18 7
2017 6 25 2017-06-19 1
2017 6 25 2017-06-20 2
2017 6 25 2017-06-21 3
2017 6 25 2017-06-22 4
2017 6 25 2017-06-23 5
2017 6 25 2017-06-24 6
2017 6 25 2017-06-25 7
2017 6 26 2017-06-26 1
2017 6 26 2017-06-27 2
2017 6 26 2017-06-28 3
2017 6 26 2017-06-29 4
2017 6 26 2017-06-30 5
2017 6 26 0 6
2017 7 25 0 7
2017 7 26 0 1
2017 7 26 0 2
2017 7 26 0 3
2017 7 26 0 4
2017 7 26 0 5
2017 7 26 2017-07-01 6
2017 7 26 2017-07-02 7
2017 7 27 2017-07-03 1
2017 7 27 2017-07-04 2
2017 7 27 2017-07-05 3
2017 7 27 2017-07-06 4
2017 7 27 2017-07-07 5
2017 7 27 2017-07-08 6
2017 7 27 2017-07-09 7
2017 7 28 2017-07-10 1
2017 7 28 2017-07-11 2
2017 7 28 2017-07-12 3
2017 7 28 2017-07-13 4
2017 7 28 2017-07-14 5
2017 7 28 2017-07-15 6
2017 7 28 2017-07-16 7
2017 7 29 2017-07-17 1
2017 7 29 2017-07-18 2
2017 7 29 2017-07-19 3
2017 7 29 2017-07-20 4
2017 7 29 2017-07-21 5
2017 7 29 2017-07-22 6
2017 7 29 2017-07-23 7
2017 7 30 2017-07-24 1
2017 7 30 2017-07-25 2
2017 7 30 2017-07-26 3
2017 7 30 2017-07-27 4
2017 7 30 2017-07-28 5
2017 7 30 2017-07-29 6
2017 7 30 2017-07-30 7
2017 7 31 2017-07-31 1
2017 7 31 0 2
2017 7 31 0 3
2017 7 31 0 4
2017 7 31 0 5
2017 7 31 0 6
2017 8 30 0 7
2017 8 31 0 1
2017 8 31 2017-08-01 2
2017 8 31 2017-08-02 3
2017 8 31 2017-08-03 4
2017 8 31 2017-08-04 5
2017 8 31 2017-08-05 6
2017 8 31 2017-08-06 7
2017 8 32 2017-08-07 1
2017 8 32 2017-08-08 2
2017 8 32 2017-08-09 3
2017 8 32 2017-08-10 4
2017 8 32 2017-08-11 5
2017 8 32 2017-08-12 6
2017 8 32 2017-08-13 7
2017 8 33 2017-08-14 1
2017 8 33 2017-08-15 2
2017 8 33 2017-08-16 3
2017 8 33 2017-08-17 4
2017 8 33 2017-08-18 5
2017 8 33 2017-08-19 6
2017 8 33 2017-08-20 7
2017 8 34 2017-08-21 1
2017 8 34 2017-08-22 2
2017 8 34 2017-08-23 3
2017 8 34 2017-08-24 4
2017 8 34 2017-08-25 5
2017 8 34 2017-08-26 6
2017 8 34 2017-08-27 7
2017 8 35 2017-08-28 1
2017 8 35 2017-08-29 2
2017 8 35 2017-08-30 3
2017 8 35 2017-08-31 4
2017 8 35 0 5
2017 8 35 0 6
2017 9 34 0 7
2017 9 35 0 1
2017 9 35 0 2
2017 9 35 0 3
2017 9 35 0 4
2017 9 35 2017-09-01 5
2017 9 35 2017-09-02 6
2017 9 35 2017-09-03 7
2017 9 36 2017-09-04 1
2017 9 36 2017-09-05 2
2017 9 36 2017-09-06 3
2017 9 36 2017-09-07 4
2017 9 36 2017-09-08 5
2017 9 36 2017-09-09 6
2017 9 36 2017-09-10 7
2017 9 37 2017-09-11 1
2017 9 37 2017-09-12 2
2017 9 37 2017-09-13 3
2017 9 37 2017-09-14 4
2017 9 37 2017-09-15 5
2017 9 37 2017-09-16 6
2017 9 37 2017-09-17 7
2017 9 38 2017-09-18 1
2017 9 38 2017-09-19 2
2017 9 38 2017-09-20 3
2017 9 38 2017-09-21 4
2017 9 38 2017-09-22 5
2017 9 38 2017-09-23 6
2017 9 38 2017-09-24 7
2017 9 39 2017-09-25 1
2017 9 39 2017-09-26 2
2017 9 39 2017-09-27 3
2017 9 39 2017-09-28 4
2017 9 39 2017-09-29 5
2017 9 39 2017-09-30 6
2017 10 39 2017-10-01 7
2017 10 40 2017-10-02 1
2017 10 40 2017-10-03 2
2017 10 40 2017-10-04 3
2017 10 40 2017-10-05 4
2017 10 40 2017-10-06 5
2017 10 40 2017-10-07 6
2017 10 40 2017-10-08 7
2017 10 41 2017-10-09 1
2017 10 41 2017-10-10 2
2017 10 41 2017-10-11 3
2017 10 41 2017-10-12 4
2017 10 41 2017-10-13 5
2017 10 41 2017-10-14 6
2017 10 41 2017-10-15 7
2017 10 42 2017-10-16 1
2017 10 42 2017-10-17 2
2017 10 42 2017-10-18 3
2017 10 42 2017-10-19 4
2017 10 42 2017-10-20 5
2017 10 42 2017-10-21 6
2017 10 42 2017-10-22 7
2017 10 43 2017-10-23 1
2017 10 43 2017-10-24 2
2017 10 43 2017-10-25 3
2017 10 43 2017-10-26 4
2017 10 43 2017-10-27 5
2017 10 43 2017-10-28 6
2017 10 43 2017-10-29 7
2017 10 44 2017-10-30 1
2017 10 44 2017-10-31 2
2017 10 44 0 3
2017 10 44 0 4
2017 10 44 0 5
2017 10 44 0 6
2017 11 43 0 7
2017 11 44 0 1
2017 11 44 0 2
2017 11 44 2017-11-01 3
2017 11 44 2017-11-02 4
2017 11 44 2017-11-03 5
2017 11 44 2017-11-04 6
2017 11 44 2017-11-05 7
2017 11 45 2017-11-06 1
2017 11 45 2017-11-07 2
2017 11 45 2017-11-08 3
2017 11 45 2017-11-09 4
2017 11 45 2017-11-10 5
2017 11 45 2017-11-11 6
2017 11 45 2017-11-12 7
2017 11 46 2017-11-13 1
2017 11 46 2017-11-14 2
2017 11 46 2017-11-15 3
2017 11 46 2017-11-16 4
2017 11 46 2017-11-17 5
2017 11 46 2017-11-18 6
2017 11 46 2017-11-19 7
2017 11 47 2017-11-20 1
2017 11 47 2017-11-21 2
2017 11 47 2017-11-22 3
2017 11 47 2017-11-23 4
2017 11 47 2017-11-24 5
2017 11 47 2017-11-25 6
2017 11 47 2017-11-26 7
2017 11 48 2017-11-27 1
2017 11 48 2017-11-28 2
2017 11 48 2017-11-29 3
2017 11 48 2017-11-30 4
2017 11 48 0 5
2017 11 48 0 6
2017 12 47 0 7
2017 12 48 0 1
2017 12 48 0 2
2017 12 48 0 3
2017 12 48 0 4
2017 12 48 2017-12-01 5
2017 12 48 2017-12-02 6
2017 12 48 2017-12-03 7
2017 12 49 2017-12-04 1
2017 12 49 2017-12-05 2
2017 12 49 2017-12-06 3
2017 12 49 2017-12-07 4
2017 12 49 2017-12-08 5
2017 12 49 2017-12-09 6
2017 12 49 2017-12-10 7
2017 12 50 2017-12-11 1
2017 12 50 2017-12-12 2
2017 12 50 2017-12-13 3
2017 12 50 2017-12-14 4
2017 12 50 2017-12-15 5
2017 12 50 2017-12-16 6
2017 12 50 2017-12-17 7
2017 12 51 2017-12-18 1
2017 12 51 2017-12-19 2
2017 12 51 2017-12-20 3
2017 12 51 2017-12-21 4
2017 12 51 2017-12-22 5
2017 12 51 2017-12-23 6
2017 12 51 2017-12-24 7
2017 12 52 2017-12-25 1
2017 12 52 2017-12-26 2
2017 12 52 2017-12-27 3
2017 12 52 2017-12-28 4
2017 12 52 2017-12-29 5
2017 12 52 2017-12-30 6
2017 12 52 2017-12-31 7
2017 12 53 0 1
2017 12 53 0 2
2017 12 53 0 3
2017 12 53 0 4
2017 12 53 0 5
2017 12 53 0 6
2018 1 0 2018-01-01 1
2018 1 0 2018-01-02 2
2018 1 0 2018-01-03 3
2018 1 0 2018-01-04 4
2018 1 0 2018-01-05 5
2018 1 0 2018-01-06 6
2018 1 0 2018-01-07 7
2018 1 1 2018-01-08 1
2018 1 1 2018-01-09 2
2018 1 1 2018-01-10 3
2018 1 1 2018-01-11 4
2018 1 1 2018-01-12 5
2018 1 1 2018-01-13 6
2018 1 1 2018-01-14 7
2018 1 2 2018-01-15 1
2018 1 2 2018-01-16 2
2018 1 2 2018-01-17 3
2018 1 2 2018-01-18 4
2018 1 2 2018-01-19 5
2018 1 2 2018-01-20 6
2018 1 2 2018-01-21 7
2018 1 3 2018-01-22 1
2018 1 3 2018-01-23 2
2018 1 3 2018-01-24 3
2018 1 3 2018-01-25 4
2018 1 3 2018-01-26 5
2018 1 3 2018-01-27 6
2018 1 3 2018-01-28 7
2018 1 4 2018-01-29 1
2018 1 4 2018-01-30 2
2018 1 4 2018-01-31 3
2018 1 4 0 4
2018 1 4 0 5
2018 1 4 0 6
2018 2 3 0 7
2018 2 4 0 1
2018 2 4 0 2
2018 2 4 0 3
2018 2 4 2018-02-01 4
2018 2 4 2018-02-02 5
2018 2 4 2018-02-03 6
2018 2 4 2018-02-04 7
2018 2 5 2018-02-05 1
2018 2 5 2018-02-06 2
2018 2 5 2018-02-07 3
2018 2 5 2018-02-08 4
2018 2 5 2018-02-09 5
2018 2 5 2018-02-10 6
2018 2 5 2018-02-11 7
2018 2 6 2018-02-12 1
2018 2 6 2018-02-13 2
2018 2 6 2018-02-14 3
2018 2 6 2018-02-15 4
2018 2 6 2018-02-16 5
2018 2 6 2018-02-17 6
2018 2 6 2018-02-18 7
2018 2 7 2018-02-19 1
2018 2 7 2018-02-20 2
2018 2 7 2018-02-21 3
2018 2 7 2018-02-22 4
2018 2 7 2018-02-23 5
2018 2 7 2018-02-24 6
2018 2 7 2018-02-25 7
2018 2 8 2018-02-26 1
2018 2 8 2018-02-27 2
2018 2 8 2018-02-28 3
2018 2 8 0 4
2018 2 8 0 5
2018 2 8 0 6
2018 3 7 0 7
2018 3 8 0 1
2018 3 8 0 2
2018 3 8 0 3
2018 3 8 2018-03-01 4
2018 3 8 2018-03-02 5
2018 3 8 2018-03-03 6
2018 3 8 2018-03-04 7
2018 3 9 2018-03-05 1
2018 3 9 2018-03-06 2
2018 3 9 2018-03-07 3
2018 3 9 2018-03-08 4
2018 3 9 2018-03-09 5
2018 3 9 2018-03-10 6
2018 3 9 2018-03-11 7
2018 3 10 2018-03-12 1
2018 3 10 2018-03-13 2
2018 3 10 2018-03-14 3
2018 3 10 2018-03-15 4
2018 3 10 2018-03-16 5
2018 3 10 2018-03-17 6
2018 3 10 2018-03-18 7
2018 3 11 2018-03-19 1
2018 3 11 2018-03-20 2
2018 3 11 2018-03-21 3
2018 3 11 2018-03-22 4
2018 3 11 2018-03-23 5
2018 3 11 2018-03-24 6
2018 3 11 2018-03-25 7
2018 3 12 2018-03-26 1
2018 3 12 2018-03-27 2
2018 3 12 2018-03-28 3
2018 3 12 2018-03-29 4
2018 3 12 2018-03-30 5
2018 3 12 2018-03-31 6
2018 4 12 2018-04-01 7
2018 4 13 2018-04-02 1
2018 4 13 2018-04-03 2
2018 4 13 2018-04-04 3
2018 4 13 2018-04-05 4
2018 4 13 2018-04-06 5
2018 4 13 2018-04-07 6
2018 4 13 2018-04-08 7
2018 4 14 2018-04-09 1
2018 4 14 2018-04-10 2
2018 4 14 2018-04-11 3
2018 4 14 2018-04-12 4
2018 4 14 2018-04-13 5
2018 4 14 2018-04-14 6
2018 4 14 2018-04-15 7
2018 4 15 2018-04-16 1
2018 4 15 2018-04-17 2
2018 4 15 2018-04-18 3
2018 4 15 2018-04-19 4
2018 4 15 2018-04-20 5
2018 4 15 2018-04-21 6
2018 4 15 2018-04-22 7
2018 4 16 2018-04-23 1
2018 4 16 2018-04-24 2
2018 4 16 2018-04-25 3
2018 4 16 2018-04-26 4
2018 4 16 2018-04-27 5
2018 4 16 2018-04-28 6
2018 4 16 2018-04-29 7
2018 4 17 2018-04-30 1
2018 4 17 0 2
2018 4 17 0 3
2018 4 17 0 4
2018 4 17 0 5
2018 4 17 0 6
2018 5 16 0 7
2018 5 17 0 1
2018 5 17 2018-05-01 2
2018 5 17 2018-05-02 3
2018 5 17 2018-05-03 4
2018 5 17 2018-05-04 5
2018 5 17 2018-05-05 6
2018 5 17 2018-05-06 7
2018 5 18 2018-05-07 1
2018 5 18 2018-05-08 2
2018 5 18 2018-05-09 3
2018 5 18 2018-05-10 4
2018 5 18 2018-05-11 5
2018 5 18 2018-05-12 6
2018 5 18 2018-05-13 7
2018 5 19 2018-05-14 1
2018 5 19 2018-05-15 2
2018 5 19 2018-05-16 3
2018 5 19 2018-05-17 4
2018 5 19 2018-05-18 5
2018 5 19 2018-05-19 6
2018 5 19 2018-05-20 7
2018 5 20 2018-05-21 1
2018 5 20 2018-05-22 2
2018 5 20 2018-05-23 3
2018 5 20 2018-05-24 4
2018 5 20 2018-05-25 5
2018 5 20 2018-05-26 6
2018 5 20 2018-05-27 7
2018 5 21 2018-05-28 1
2018 5 21 2018-05-29 2
2018 5 21 2018-05-30 3
2018 5 21 2018-05-31 4
2018 5 21 0 5
2018 5 21 0 6
2018 6 20 0 7
2018 6 21 0 1
2018 6 21 0 2
2018 6 21 0 3
2018 6 21 0 4
2018 6 21 2018-06-01 5
2018 6 21 2018-06-02 6
2018 6 21 2018-06-03 7
2018 6 22 2018-06-04 1
2018 6 22 2018-06-05 2
2018 6 22 2018-06-06 3
2018 6 22 2018-06-07 4
2018 6 22 2018-06-08 5
2018 6 22 2018-06-09 6
2018 6 22 2018-06-10 7
2018 6 23 2018-06-11 1
2018 6 23 2018-06-12 2
2018 6 23 2018-06-13 3
2018 6 23 2018-06-14 4
2018 6 23 2018-06-15 5
2018 6 23 2018-06-16 6
2018 6 23 2018-06-17 7
2018 6 24 2018-06-18 1
2018 6 24 2018-06-19 2
2018 6 24 2018-06-20 3
2018 6 24 2018-06-21 4
2018 6 24 2018-06-22 5
2018 6 24 2018-06-23 6
2018 6 24 2018-06-24 7
2018 6 25 2018-06-25 1
2018 6 25 2018-06-26 2
2018 6 25 2018-06-27 3
2018 6 25 2018-06-28 4
2018 6 25 2018-06-29 5
2018 6 25 2018-06-30 6
2018 7 25 2018-07-01 7
2018 7 26 2018-07-02 1
2018 7 26 2018-07-03 2
2018 7 26 2018-07-04 3
2018 7 26 2018-07-05 4
2018 7 26 2018-07-06 5
2018 7 26 2018-07-07 6
2018 7 26 2018-07-08 7
2018 7 27 2018-07-09 1
2018 7 27 2018-07-10 2
2018 7 27 2018-07-11 3
2018 7 27 2018-07-12 4
2018 7 27 2018-07-13 5
2018 7 27 2018-07-14 6
2018 7 27 2018-07-15 7
2018 7 28 2018-07-16 1
2018 7 28 2018-07-17 2
2018 7 28 2018-07-18 3
2018 7 28 2018-07-19 4
2018 7 28 2018-07-20 5
2018 7 28 2018-07-21 6
2018 7 28 2018-07-22 7
2018 7 29 2018-07-23 1
2018 7 29 2018-07-24 2
2018 7 29 2018-07-25 3
2018 7 29 2018-07-26 4
2018 7 29 2018-07-27 5
2018 7 29 2018-07-28 6
2018 7 29 2018-07-29 7
2018 7 30 2018-07-30 1
2018 7 30 2018-07-31 2
2018 7 30 0 3
2018 7 30 0 4
2018 7 30 0 5
2018 7 30 0 6
2018 8 29 0 7
2018 8 30 0 1
2018 8 30 0 2
2018 8 30 2018-08-01 3
2018 8 30 2018-08-02 4
2018 8 30 2018-08-03 5
2018 8 30 2018-08-04 6
2018 8 30 2018-08-05 7
2018 8 31 2018-08-06 1
2018 8 31 2018-08-07 2
2018 8 31 2018-08-08 3
2018 8 31 2018-08-09 4
2018 8 31 2018-08-10 5
2018 8 31 2018-08-11 6
2018 8 31 2018-08-12 7
2018 8 32 2018-08-13 1
2018 8 32 2018-08-14 2
2018 8 32 2018-08-15 3
2018 8 32 2018-08-16 4
2018 8 32 2018-08-17 5
2018 8 32 2018-08-18 6
2018 8 32 2018-08-19 7
2018 8 33 2018-08-20 1
2018 8 33 2018-08-21 2
2018 8 33 2018-08-22 3
2018 8 33 2018-08-23 4
2018 8 33 2018-08-24 5
2018 8 33 2018-08-25 6
2018 8 33 2018-08-26 7
2018 8 34 2018-08-27 1
2018 8 34 2018-08-28 2
2018 8 34 2018-08-29 3
2018 8 34 2018-08-30 4
2018 8 34 2018-08-31 5
2018 8 34 0 6
2018 9 33 0 7
2018 9 34 0 1
2018 9 34 0 2
2018 9 34 0 3
2018 9 34 0 4
2018 9 34 0 5
2018 9 34 2018-09-01 6
2018 9 34 2018-09-02 7
2018 9 35 2018-09-03 1
2018 9 35 2018-09-04 2
2018 9 35 2018-09-05 3
2018 9 35 2018-09-06 4
2018 9 35 2018-09-07 5
2018 9 35 2018-09-08 6
2018 9 35 2018-09-09 7
2018 9 36 2018-09-10 1
2018 9 36 2018-09-11 2
2018 9 36 2018-09-12 3
2018 9 36 2018-09-13 4
2018 9 36 2018-09-14 5
2018 9 36 2018-09-15 6
2018 9 36 2018-09-16 7
2018 9 37 2018-09-17 1
2018 9 37 2018-09-18 2
2018 9 37 2018-09-19 3
2018 9 37 2018-09-20 4
2018 9 37 2018-09-21 5
2018 9 37 2018-09-22 6
2018 9 37 2018-09-23 7
2018 9 38 2018-09-24 1
2018 9 38 2018-09-25 2
2018 9 38 2018-09-26 3
2018 9 38 2018-09-27 4
2018 9 38 2018-09-28 5
2018 9 38 2018-09-29 6
2018 9 38 2018-09-30 7
2018 9 39 0 1
2018 9 39 0 2
2018 9 39 0 3
2018 9 39 0 4
2018 9 39 0 5
2018 9 39 0 6
2018 10 38 0 7
2018 10 39 2018-10-01 1
2018 10 39 2018-10-02 2
2018 10 39 2018-10-03 3
2018 10 39 2018-10-04 4
2018 10 39 2018-10-05 5
2018 10 39 2018-10-06 6
2018 10 39 2018-10-07 7
2018 10 40 2018-10-08 1
2018 10 40 2018-10-09 2
2018 10 40 2018-10-10 3
2018 10 40 2018-10-11 4
2018 10 40 2018-10-12 5
2018 10 40 2018-10-13 6
2018 10 40 2018-10-14 7
2018 10 41 2018-10-15 1
2018 10 41 2018-10-16 2
2018 10 41 2018-10-17 3
2018 10 41 2018-10-18 4
2018 10 41 2018-10-19 5
2018 10 41 2018-10-20 6
2018 10 41 2018-10-21 7
2018 10 42 2018-10-22 1
2018 10 42 2018-10-23 2
2018 10 42 2018-10-24 3
2018 10 42 2018-10-25 4
2018 10 42 2018-10-26 5
2018 10 42 2018-10-27 6
2018 10 42 2018-10-28 7
2018 10 43 2018-10-29 1
2018 10 43 2018-10-30 2
2018 10 43 2018-10-31 3
2018 10 43 0 4
2018 10 43 0 5
2018 10 43 0 6
2018 11 42 0 7
2018 11 43 0 1
2018 11 43 0 2
2018 11 43 0 3
2018 11 43 2018-11-01 4
2018 11 43 2018-11-02 5
2018 11 43 2018-11-03 6
2018 11 43 2018-11-04 7
2018 11 44 2018-11-05 1
2018 11 44 2018-11-06 2
2018 11 44 2018-11-07 3
2018 11 44 2018-11-08 4
2018 11 44 2018-11-09 5
2018 11 44 2018-11-10 6
2018 11 44 2018-11-11 7
2018 11 45 2018-11-12 1
2018 11 45 2018-11-13 2
2018 11 45 2018-11-14 3
2018 11 45 2018-11-15 4
2018 11 45 2018-11-16 5
2018 11 45 2018-11-17 6
2018 11 45 2018-11-18 7
2018 11 46 2018-11-19 1
2018 11 46 2018-11-20 2
2018 11 46 2018-11-21 3
2018 11 46 2018-11-22 4
2018 11 46 2018-11-23 5
2018 11 46 2018-11-24 6
2018 11 46 2018-11-25 7
2018 11 47 2018-11-26 1
2018 11 47 2018-11-27 2
2018 11 47 2018-11-28 3
2018 11 47 2018-11-29 4
2018 11 47 2018-11-30 5
2018 11 47 0 6
2018 12 46 0 7
2018 12 47 0 1
2018 12 47 0 2
2018 12 47 0 3
2018 12 47 0 4
2018 12 47 0 5
2018 12 47 2018-12-01 6
2018 12 47 2018-12-02 7
2018 12 48 2018-12-03 1
2018 12 48 2018-12-04 2
2018 12 48 2018-12-05 3
2018 12 48 2018-12-06 4
2018 12 48 2018-12-07 5
2018 12 48 2018-12-08 6
2018 12 48 2018-12-09 7
2018 12 49 2018-12-10 1
2018 12 49 2018-12-11 2
2018 12 49 2018-12-12 3
2018 12 49 2018-12-13 4
2018 12 49 2018-12-14 5
2018 12 49 2018-12-15 6
2018 12 49 2018-12-16 7
2018 12 50 2018-12-17 1
2018 12 50 2018-12-18 2
2018 12 50 2018-12-19 3
2018 12 50 2018-12-20 4
2018 12 50 2018-12-21 5
2018 12 50 2018-12-22 6
2018 12 50 2018-12-23 7
2018 12 51 2018-12-24 1
2018 12 51 2018-12-25 2
2018 12 51 2018-12-26 3
2018 12 51 2018-12-27 4
2018 12 51 2018-12-28 5
2018 12 51 2018-12-29 6
2018 12 51 2018-12-30 7
2018 12 52 2018-12-31 1
2018 12 52 0 2
2018 12 52 0 3
2018 12 52 0 4
2018 12 52 0 5
2018 12 52 0 6
-- supporting SQL Schema
CREATE TABLE `date_48361641` (
`date` date DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
truncate date_48361641 ;
insert into date_48361641 ( `date` )
select * from
(select adddate('1970-01-01',t4.i*10000 + t3.i*1000 + t2.i*100 + t1.i*10 + t0.i) selected_date from
(select 0 i union select 1 union select 2 union select 3 union select 4 union select 5 union select 6 union select 7 union select 8 union select 9) t0,
(select 0 i union select 1 union select 2 union select 3 union select 4 union select 5 union select 6 union select 7 union select 8 union select 9) t1,
(select 0 i union select 1 union select 2 union select 3 union select 4 union select 5 union select 6 union select 7 union select 8 union select 9) t2,
(select 0 i union select 1 union select 2 union select 3 union select 4 union select 5 union select 6 union select 7 union select 8 union select 9) t3,
(select 0 i union select 1 union select 2 union select 3 union select 4 union select 5 union select 6 union select 7 union select 8 union select 9) t4) v
where selected_date between '2016-01-01' and '2018-12-31' ;
Something like this should work
with allDates as (
see link below to finish this part
)
select DateFieldFromYourTable
, isnull(WeekDay, 0) DayOfWeek
from allDates left join YourTable on allDates.Something = DateFieldFromYourTable
Read this to get the code for your subquery.

Dates between two dates from a table

I can't find the specific answer to this question but apologies if it has been asked previously.
I have the following example table which I have kept simple but it contains more rows and Types. It gets updated frequently.
Type From To Qty
1 2016-01-01 00:00:00.0000000 2016-01-03 00:00:00.0000000 30
1 2016-01-04 00:00:00.0000000 2016-01-05 00:00:00.0000000 31
1 2016-01-06 00:00:00.0000000 NULL 31
2 2016-04-24 00:00:00.0000000 NULL 15
I want to be able to update a table every day (as shown below) so it shows all of the dates between (and including) the From and To dates. The Qty for the relevant date must be displayed up to todays date where the TO is NULL.
Type Date Qty
1 2016-01-01 00:00:00.0000000 30
1 2016-01-02 00:00:00.0000000 30
1 2016-01-03 00:00:00.0000000 30
1 2016-04-04 00:00:00.0000000 31
1 2016-04-05 00:00:00.0000000 31
1 2016-04-06 00:00:00.0000000 31
1 2016-04-07 00:00:00.0000000 31
1 .... up to today where TO is NULL
1 2016-07-25 00:00:00.0000000 31
2 2016-04-24 00:00:00.0000000 15
2 .... up to today where TO is NULL
2 2016-07-25 00:00:00.0000000 15
Thank you in advance for your help.
Using Numbers table..
Demo Here
select b.*,qty from #test
cross apply
(
select dateadd(day,n,fromdate) from
numbers
where n<=
case when todate is null
then datediff(day,fromdate,getdate()) else datediff(day,fromdate,todate) end
) b(upd)
You can do this using a recursive CTE to generate all of the dates and JOIN to that for the result:
Test Data
Create Table Test
(
[Type] Int,
[From] Date,
[To] Date,
Qty Int
)
Insert Test
Values
(1, '2016-01-01', '2016-01-03', 30 ),
(1, '2016-01-04', '2016-01-05', 31 ),
(1, '2016-01-06', NULL, 31 ),
(2, '2016-04-24', NULL, 15 )
Query
;With MinMax As
(
Select Min([From]) MinFrom,
Max([To]) MaxTo,
Convert(Date, GetDate()) Today
From Test
), Date (Date) As
(
Select MinFrom
From MinMax
Union All
Select DateAdd(Day, 1, Date)
From Date
Where Date < (Select MaxTo From MinMax)
Or Date < (Select Today From MinMax)
)
Select T.[Type],
D.[Date],
T.Qty
From Test T
Join Date D On D.Date Between T.[From] And Coalesce(T.[To], Convert(Date, GetDate()))
Order By T.[Type], D.[Date]
Option (MaxRecursion 0)
Results
Type Date Qty
1 2016-01-01 30
1 2016-01-02 30
1 2016-01-03 30
1 2016-01-04 31
1 2016-01-05 31
1 2016-01-06 31
1 2016-01-07 31
1 2016-01-08 31
1 2016-01-09 31
1 2016-01-10 31
1 2016-01-11 31
1 2016-01-12 31
1 2016-01-13 31
1 2016-01-14 31
1 2016-01-15 31
1 2016-01-16 31
1 2016-01-17 31
1 2016-01-18 31
1 2016-01-19 31
1 2016-01-20 31
1 2016-01-21 31
1 2016-01-22 31
1 2016-01-23 31
1 2016-01-24 31
1 2016-01-25 31
1 2016-01-26 31
1 2016-01-27 31
1 2016-01-28 31
1 2016-01-29 31
1 2016-01-30 31
1 2016-01-31 31
1 2016-02-01 31
1 2016-02-02 31
1 2016-02-03 31
1 2016-02-04 31
1 2016-02-05 31
1 2016-02-06 31
1 2016-02-07 31
1 2016-02-08 31
1 2016-02-09 31
1 2016-02-10 31
1 2016-02-11 31
1 2016-02-12 31
1 2016-02-13 31
1 2016-02-14 31
1 2016-02-15 31
1 2016-02-16 31
1 2016-02-17 31
1 2016-02-18 31
1 2016-02-19 31
1 2016-02-20 31
1 2016-02-21 31
1 2016-02-22 31
1 2016-02-23 31
1 2016-02-24 31
1 2016-02-25 31
1 2016-02-26 31
1 2016-02-27 31
1 2016-02-28 31
1 2016-02-29 31
1 2016-03-01 31
1 2016-03-02 31
1 2016-03-03 31
1 2016-03-04 31
1 2016-03-05 31
1 2016-03-06 31
1 2016-03-07 31
1 2016-03-08 31
1 2016-03-09 31
1 2016-03-10 31
1 2016-03-11 31
1 2016-03-12 31
1 2016-03-13 31
1 2016-03-14 31
1 2016-03-15 31
1 2016-03-16 31
1 2016-03-17 31
1 2016-03-18 31
1 2016-03-19 31
1 2016-03-20 31
1 2016-03-21 31
1 2016-03-22 31
1 2016-03-23 31
1 2016-03-24 31
1 2016-03-25 31
1 2016-03-26 31
1 2016-03-27 31
1 2016-03-28 31
1 2016-03-29 31
1 2016-03-30 31
1 2016-03-31 31
1 2016-04-01 31
1 2016-04-02 31
1 2016-04-03 31
1 2016-04-04 31
1 2016-04-05 31
1 2016-04-06 31
1 2016-04-07 31
1 2016-04-08 31
1 2016-04-09 31
1 2016-04-10 31
1 2016-04-11 31
1 2016-04-12 31
1 2016-04-13 31
1 2016-04-14 31
1 2016-04-15 31
1 2016-04-16 31
1 2016-04-17 31
1 2016-04-18 31
1 2016-04-19 31
1 2016-04-20 31
1 2016-04-21 31
1 2016-04-22 31
1 2016-04-23 31
1 2016-04-24 31
1 2016-04-25 31
1 2016-04-26 31
1 2016-04-27 31
1 2016-04-28 31
1 2016-04-29 31
1 2016-04-30 31
1 2016-05-01 31
1 2016-05-02 31
1 2016-05-03 31
1 2016-05-04 31
1 2016-05-05 31
1 2016-05-06 31
1 2016-05-07 31
1 2016-05-08 31
1 2016-05-09 31
1 2016-05-10 31
1 2016-05-11 31
1 2016-05-12 31
1 2016-05-13 31
1 2016-05-14 31
1 2016-05-15 31
1 2016-05-16 31
1 2016-05-17 31
1 2016-05-18 31
1 2016-05-19 31
1 2016-05-20 31
1 2016-05-21 31
1 2016-05-22 31
1 2016-05-23 31
1 2016-05-24 31
1 2016-05-25 31
1 2016-05-26 31
1 2016-05-27 31
1 2016-05-28 31
1 2016-05-29 31
1 2016-05-30 31
1 2016-05-31 31
1 2016-06-01 31
1 2016-06-02 31
1 2016-06-03 31
1 2016-06-04 31
1 2016-06-05 31
1 2016-06-06 31
1 2016-06-07 31
1 2016-06-08 31
1 2016-06-09 31
1 2016-06-10 31
1 2016-06-11 31
1 2016-06-12 31
1 2016-06-13 31
1 2016-06-14 31
1 2016-06-15 31
1 2016-06-16 31
1 2016-06-17 31
1 2016-06-18 31
1 2016-06-19 31
1 2016-06-20 31
1 2016-06-21 31
1 2016-06-22 31
1 2016-06-23 31
1 2016-06-24 31
1 2016-06-25 31
1 2016-06-26 31
1 2016-06-27 31
1 2016-06-28 31
1 2016-06-29 31
1 2016-06-30 31
1 2016-07-01 31
1 2016-07-02 31
1 2016-07-03 31
1 2016-07-04 31
1 2016-07-05 31
1 2016-07-06 31
1 2016-07-07 31
1 2016-07-08 31
1 2016-07-09 31
1 2016-07-10 31
1 2016-07-11 31
1 2016-07-12 31
1 2016-07-13 31
1 2016-07-14 31
1 2016-07-15 31
1 2016-07-16 31
1 2016-07-17 31
1 2016-07-18 31
1 2016-07-19 31
1 2016-07-20 31
1 2016-07-21 31
1 2016-07-22 31
1 2016-07-23 31
1 2016-07-24 31
1 2016-07-25 31
1 2016-07-26 31
2 2016-04-24 15
2 2016-04-25 15
2 2016-04-26 15
2 2016-04-27 15
2 2016-04-28 15
2 2016-04-29 15
2 2016-04-30 15
2 2016-05-01 15
2 2016-05-02 15
2 2016-05-03 15
2 2016-05-04 15
2 2016-05-05 15
2 2016-05-06 15
2 2016-05-07 15
2 2016-05-08 15
2 2016-05-09 15
2 2016-05-10 15
2 2016-05-11 15
2 2016-05-12 15
2 2016-05-13 15
2 2016-05-14 15
2 2016-05-15 15
2 2016-05-16 15
2 2016-05-17 15
2 2016-05-18 15
2 2016-05-19 15
2 2016-05-20 15
2 2016-05-21 15
2 2016-05-22 15
2 2016-05-23 15
2 2016-05-24 15
2 2016-05-25 15
2 2016-05-26 15
2 2016-05-27 15
2 2016-05-28 15
2 2016-05-29 15
2 2016-05-30 15
2 2016-05-31 15
2 2016-06-01 15
2 2016-06-02 15
2 2016-06-03 15
2 2016-06-04 15
2 2016-06-05 15
2 2016-06-06 15
2 2016-06-07 15
2 2016-06-08 15
2 2016-06-09 15
2 2016-06-10 15
2 2016-06-11 15
2 2016-06-12 15
2 2016-06-13 15
2 2016-06-14 15
2 2016-06-15 15
2 2016-06-16 15
2 2016-06-17 15
2 2016-06-18 15
2 2016-06-19 15
2 2016-06-20 15
2 2016-06-21 15
2 2016-06-22 15
2 2016-06-23 15
2 2016-06-24 15
2 2016-06-25 15
2 2016-06-26 15
2 2016-06-27 15
2 2016-06-28 15
2 2016-06-29 15
2 2016-06-30 15
2 2016-07-01 15
2 2016-07-02 15
2 2016-07-03 15
2 2016-07-04 15
2 2016-07-05 15
2 2016-07-06 15
2 2016-07-07 15
2 2016-07-08 15
2 2016-07-09 15
2 2016-07-10 15
2 2016-07-11 15
2 2016-07-12 15
2 2016-07-13 15
2 2016-07-14 15
2 2016-07-15 15
2 2016-07-16 15
2 2016-07-17 15
2 2016-07-18 15
2 2016-07-19 15
2 2016-07-20 15
2 2016-07-21 15
2 2016-07-22 15
2 2016-07-23 15
2 2016-07-24 15
2 2016-07-25 15
2 2016-07-26 15

SQL- calculating daily stock levels for month as aggregate of availability

I have a table containing following records of stocks from different depots in region. this contains:
itemName
startDate
endDate
quantity
The fields are
key(pk)
itemName- numeric code
startDate- date
endDate- date
amt- number
Sample data with 3 item types
1 101 Jan 1, 2013 Jan 14, 2013 15
2 101 Jan 12, 2013 Jan 15, 2013 3
3 102 Jan 4, 2013 Jan 26, 2013 7
4 102 Jan 6, 2013 Jan 12, 2013 19
5 103 Jan 15, 2013 Jan 16, 2013 3
6 103 Jan 12, 2013 Jan 21, 2013 19
How do I write a query that will get the number of items of each time every day in this period? Essentially I need to have a query that will add up applicable items between startDate and endDate. Thanks
I would want a final query result to look like that would add overlaps for each item
Jan 1 101 15
Jan 1 102 0
Jan 12 101 18
Jan 15 101 3
Jan 16 101 3
while I know i can do for a given date
SELECT item, sum(amt)
FROM [table]
WHERE (date>=startdate) AND (date<=enddate)
GROUP BY item
How do I enable it iterate for the whole month(Jan 1st to 31st) to produce such a report?
Here's what you need to do:
Create a table named [DayNumbers] and fill it with the numbers from 1 through 31:
DayNumber
---------
1
2
3
...
30
31
Now create a saved query in Access named [MonthDates] to create a row for each day in a specified month:
PARAMETERS SelectedYear Long, SelectedMonth Long;
SELECT DateSerial([SelectedYear], [SelectedMonth], DayNumber) AS StatusDate
FROM DayNumbers
WHERE Month(DateSerial([SelectedYear], [SelectedMonth], DayNumber)) = [SelectedMonth];
Note that the WHERE clause restricts the number of days to the actual number of days in the month (e.g., 30 for April).
Create another saved query in Access named [StockStatusRows] to create a row for each day and each item
SELECT StatusDate, itemName
FROM
MonthDates,
(
SELECT DISTINCT itemName FROM StockData
) AS Items;
For test data in [StockStatus] that looks like
key itemName startDate endDate amt
--- -------- ---------- ---------- ---
1 101 2013-01-01 2013-01-14 15
2 101 2013-01-12 2013-01-15 3
3 102 2013-01-04 2013-01-26 7
4 102 2013-01-06 2013-01-12 19
5 103 2013-01-15 2013-01-16 3
6 103 2013-01-12 2013-01-21 19
7 101 2013-01-30 2013-02-03 6
8 102 2013-02-05 2013-02-23 9
9 103 2013-02-07 2013-03-02 11
the [StockStatusRows] query will return
StatusDate itemName
---------- --------
2013-01-01 101
2013-01-02 101
2013-01-03 101
..
2013-01-30 101
2013-01-31 101
2013-01-01 102
2013-01-02 102
2013-01-03 102
...
2013-01-30 102
2013-01-31 102
2013-01-01 103
2013-01-02 103
2013-01-03 103
...
2013-01-30 103
2013-01-31 103
Now we can pull together the actual stock values like so:
SELECT ssr.StatusDate, ssr.itemName, Nz(sums.total, 0) AS TotalOnHand
FROM
StockStatusRows AS ssr
LEFT JOIN
(
SELECT StatusDate, itemName, Sum(amt) AS total
FROM
(
SELECT md.StatusDate, sd.itemName, sd.amt
FROM
StockData sd
INNER JOIN
MonthDates md
ON md.StatusDate>=sd.startDate
And md.StatusDate<=sd.endDate
)
GROUP BY StatusDate, itemName
) AS sums
ON (sums.itemName=ssr.itemName)
AND (sums.StatusDate=ssr.StatusDate)
ORDER BY ssr.StatusDate, ssr.itemName;
returning
StatusDate itemName TotalOnHand
---------- -------- -----------
2013-01-01 101 15
2013-01-01 102 0
2013-01-01 103 0
2013-01-02 101 15
2013-01-02 102 0
2013-01-02 103 0
2013-01-03 101 15
2013-01-03 102 0
2013-01-03 103 0
2013-01-04 101 15
2013-01-04 102 7
2013-01-04 103 0
2013-01-05 101 15
2013-01-05 102 7
2013-01-05 103 0
2013-01-06 101 15
2013-01-06 102 26
2013-01-06 103 0
...
2013-01-12 101 18
2013-01-12 102 26
2013-01-12 103 19
2013-01-13 101 18
2013-01-13 102 7
2013-01-13 103 19
2013-01-14 101 18
2013-01-14 102 7
2013-01-14 103 19
2013-01-15 101 3
2013-01-15 102 7
2013-01-15 103 22
2013-01-16 101 0
2013-01-16 102 7
2013-01-16 103 22
2013-01-17 101 0
2013-01-17 102 7
2013-01-17 103 19
...
2013-01-22 101 0
2013-01-22 102 7
2013-01-22 103 0
...
2013-01-31 101 6
2013-01-31 102 0
2013-01-31 103 0
select itemName from <Table-Name> where startDate>=(start-date) startDate<=(end-date) and endDate>=(start-date) and endDate<=(end-date) group by itemName.
This would calculate the sum of quantities of each product between (start-date) and (end-date).
If you want just total of all items irrespective of their type,
select sum(quantity) from <Table-Name> where startDate>=(start-date) startDate<=(end-date) and endDate>=(start-date) and endDate<=(end-date)
Hope this helps