get weather forecast for day and night only - openweathermap

I am hoping to use openweathermap for forecast but on a daily basis (one forecast per day), instead of ever 3-hour per day forecast.
I don't thikn OWM have such an end point but is there away it can be calculated once data is retrieved?

Related

Business Intelligence: how to measure the impact of the day of week/month to the month sales

that's my first time here, I'm a begginer at Data Science.
I would like to ask for suggestions for the best way or algorithm to complete this task:
Predict the total month sale based in day of the week and the day of the month, so I think it could be simple as a weighted average, after measuring the impact of like Wednesday in the 5th day of month.
Total Sales = (1º Impact: of Day of Month, 2º Impact: Day of Month )
It would have to answer the following questions:
How is the month/week sale in relation to the average of expected for this day of week / month.
Create a profitable ranking for the combination of day of week / month.

How do I summarise month to date forecast for current month in Power Pivot?

I have a table in a data model that has forecast figures for the next 3 months. What I want to do is to show what the forecast number for the current month to date is.
When I use the DATESMTD function like this:
=CALCULATE(SUM(InternetSales_USD[SalesAmount_USD]),DATESMTD(DateTime[DateKey]))
I get the last month of my data summarised as a total. I assume that is because the DATESMTD function takes the last date in the column and that is 3 months away.
How do I make sure I get this current month MTD total rather then the end of the calendar? The formula should be clever enough to realise I am in May and want the May MTD not the August MTD.
Any ideas?
The way to do this is to do this:
Forecast_Transaction_MTD:=CALCULATE(sum('ATO Online'[2017 Transaction Forecast]), DATESINPERIOD('ATO Online'[Current Year],TODAY(),-day(TODAY()),day))
the last -day(TODAY()) gets the day number for the current day and subtract it from today's date. So, today is the 25 May. the -day(TODAY())),day)) extracts the day (25) and subtracts it from the current date to get me to the 1 May.
The rest of the formula just adds the total for the dates.

SQL Statement to return previous quarter balance

I'm trying to create a query that can return the previous quarter balance for a series of records.
I have financial data for accountid (acctid), fiscal year (fyear), fiscal quarter (fquarter) and fiscal period (fperiod) that I'm summing and tracking through a series of other queries that I'm dropping in to a temporary table, that data includes the net change for the period (nperiod), net change for the quarter (nquarter) and net change for the year (nyear). Net change for the period is only the account transactions in the period, net change for the quarter is the cumulative total of the transactions that appear in periods 1-3, 4-6, 7-9 and 10-12 respectively (amount from previous periods are not calculated in proceeding quarters, ie the net change for the quarter resets to $0 for periods 4, 7 and 9) and the net change for the year is the total cumulative sum. I'm now trying to create a sql statement that returns the previous quarter end balance.
So for periods 1-3 I need to write a separate select statements to return the ending balance for the previous year, for periods 4-6 I want them ALL to return the net change for the quarter from period 3, for 7-9 I want to return the net change for the quarter from period 6 for all records and for period 10-12 I want to return net change for the quarter from period 9.
Can I get some assistance because I have a gigantic query that returns the max period per quarter, then the nquarter amount associated with that period and then trying to do a where exists, but something tells me there's a better way to do it.
Thanks!

Single SQL Server query to get the total score by hourly, daily, weekly, monthly, and annual

I have the following requirement :
single SQL Server query to get the total score by hourly, daily, weekly, monthly, and annual data.
this is how the result should be:
thisperiodtotalscore previousperiodtotalscore sumtotalscore periodType
which meets the following criteria:
where score comes from the table data, totalscore has to be summed up for the different members of different teams,
where period can be hourly, daily, weekly, monthly, and annual and hourly is determined by the working hour definition, say it can be any number of selected hours (example: 1st working hour, 2nd working hour, and so on..)
and weekly determined by working days definition, say it can be wednesday to wednesday,..)
and likewise for monthy and annual
If the period has empty data, say if it is a holiday/leave that particular period should not be skipped in the count.
Note:
thisperiodtotalscore (this period total score can be for any of the periods (hourly, daily, weekly, monthly, annual) for the user date input) - say the corresponding week score of the user input, the corresponding month score of the user date input, .. likewise
previousperiodtotalscore (previous period total score can be for any of the periods (hourly, daily, weekly, monthly, annual) for the user date input) - say previous week score of the user date input, previous month score of the user date input,.. likewise
sumtotalscore - total of the thisperiodtotalscore and previousperiodtotalscore
periodType - hourly, daily, weekly, monthly, annual, based on the period request type
and which meets the following criteria:
where score comes from the table data, totalscore has to be summed up for the different members of different teams,
where period can be hourly, daily, weekly, monthly, and annual
and hourly is determined by the working hour definition, say it can be any number of selected hours (example: 1st working hour, 2nd working hour, and so on..)
and weekly determined by working days definition, say it can be wednesday to wednesday,..)
and likewise for monthly and annual
If the period has empty data, say if it is a holiday/leave that particular period should not be skipped in the count.
This is the requirement, also Welcome for other possible cases if missed in such kind of scenarios.
Thanks in advance,
GravityPush
For start, take a look at DimDate in AdventureWorksDW sample. You can have a similar table in your database and write some join queries. I suggest use queries which are dynamically grouped by different columns of DimDate.

billing module

I'm launching a small service and plan to charge monthly (eg- will be advertised as $10 monthly). I'm working on the billing module right now but was wondering about a small bit:
I plan to bill customers when they first register and then at regular intervals thereafter. Getting to my question- Some months have less than 30 days. Does monthly billing imply exactly a 30 day interval or would anything between 28-30 days be considered a monthly interval?
I was planning on doing 30 because it seems that's what customers would expect, but I'm also curious if some companies charge at a fixed interval other than 30 days.
Billing monthly is assumed to be 12 times per year, not once every thirty days.
Preferably, billing should be on the anniversary of the original billing date of the month. If the current month has fewer days than the original billing DOM, bill on the last day of the current month, but on the next month, bill again on the anniversary day.