Showing posts with label product. Show all posts
Showing posts with label product. Show all posts

Monday, March 19, 2012

Doubts regarding Sales Forecast model

I have few more clarification regarding time series.

Firstly

In my model the month level product sales value represented across 1st day of every month.So that the key time column is of datetime datatype containing a sequence of dates representing the 1st day of every month of the year.

Eg: 2006-01-01, 2006-02-01………. etc. all in (yy-mm-dd) format

But

when I make prediction for next five months, though it makes monthly

predictions the date part for the months are random whereas I expect

the date part to be 1st of every month.What is the reason for this and how can I overcome it.

Secondly

Predicted

sales values for some time period are negative though I do not have any

negative value in the training data. What is the reason for this and

how can I rectify it?

Thirdly

In

one of your earlier posts you had said that the time series algorithm

does not have any built in time intelligence but uses the key time

column as a time sequence stamp. So If have to make predictions for a

particular time period where the time slice for each time period is 25

days or 50 days etc, then I understand that the input data used to

train the model should be in the same time sequence.

Or

Can I specify the span of the time period according to which the prediction needs to be made?

Basically

how can I use the same time series model to make monthly, yearly,

quarterly, daily or predictions or for custom time period like I have

mentioned above.

1: There really isn't a workaround - you should use your own logic for dates

2: There is a parameter MINIMUM_PREDICTION_VALUE (or something like that) that you can set to 0, and you won't get negative predictions.

3: You should make unique models for each period you want to analyze - the patterns and periodicities are different, and need different analyses.

|||Thanks Jamie

Double-Take vs SQL Server Replication?

In another thread I noticed that Hilary mentioned Double-Take. I
had forgotten about this product.
I am curious if Double-Take would be a better solution for a
standby server, as wouldn't it replicate both ddl an dml data?
Anyone know aproximate cost of this product for a 2 server
enviornment?
Thanks
Dave
Its expensive, IIRC and I could be way off here it costs between 10 to 20k
for a per server license. This was about 4 years ago.
It works by shoehorning a driver between the file system and the OS, it then
sends the deltas to the secondary. It does use some CPU and RAM. RAM
consumption can be significant if your secondary goes off line. It
replicates/mirrors the entire drive/array so you can't do any form of
filtering which can be a good or bad thing for you. So it does replicate DML
and DDL.
In general it is not really scalable so it really is only a good choice in a
limited set of circumstances.
Hilary Cotter
Looking for a SQL Server replication book?
http://www.nwsu.com/0974973602.html
Looking for a FAQ on Indexing Services/SQL FTS
http://www.indexserverfaq.com
"David Gresham" <gresham@.panix.com> wrote in message
news:d5d37l$m4m$1@.reader1.panix.com...
> In another thread I noticed that Hilary mentioned Double-Take. I
> had forgotten about this product.
> I am curious if Double-Take would be a better solution for a
> standby server, as wouldn't it replicate both ddl an dml data?
>
> Anyone know aproximate cost of this product for a 2 server
> enviornment?
>
> Thanks
>
> Dave
>
|||I saw a presentation of double-take and geo-cluster from NSI software last
month...IIRC, the pricing was between $2495 and $5000 per server, but I
don't recall which price was for which product.
Kevin Hill
President
3NF Consulting
www.3nf-inc.com/NewsGroups.htm
www.DallasDBAs.com/forum - new DB forum for Dallas/Ft. Worth area DBAs.
www.experts-exchange.com - experts compete for points to answer your
questions
"Hilary Cotter" <hilary.cotter@.gmail.com> wrote in message
news:eUx8uNYUFHA.1944@.TK2MSFTNGP14.phx.gbl...
> Its expensive, IIRC and I could be way off here it costs between 10 to 20k
> for a per server license. This was about 4 years ago.
> It works by shoehorning a driver between the file system and the OS, it
> then
> sends the deltas to the secondary. It does use some CPU and RAM. RAM
> consumption can be significant if your secondary goes off line. It
> replicates/mirrors the entire drive/array so you can't do any form of
> filtering which can be a good or bad thing for you. So it does replicate
> DML
> and DDL.
> In general it is not really scalable so it really is only a good choice in
> a
> limited set of circumstances.
> --
> Hilary Cotter
> Looking for a SQL Server replication book?
> http://www.nwsu.com/0974973602.html
> Looking for a FAQ on Indexing Services/SQL FTS
> http://www.indexserverfaq.com
> "David Gresham" <gresham@.panix.com> wrote in message
> news:d5d37l$m4m$1@.reader1.panix.com...
>

Sunday, March 11, 2012

double-take for high availability?

has anyone used double-take for high availability solution?
i am interested in product short comings and pitfalls when used in
conjunction with sql server.
thanks, gigel
No Microsoft support...big short-coming.
But I have seen the demos and heard good things about it from the SBS crowd.

Kevin3NF
SQL Server dude
You want fries with that?
http://kevin3nf.blogspot.com/
I only check the newsgroups during work hours, M-F.
Hit my blog and the contact links if necessary...I may be available.
"Gigel" <gigel@.microsoft.com> wrote in message
news:eMB8816fIHA.4476@.TK2MSFTNGP06.phx.gbl...
> has anyone used double-take for high availability solution?
> i am interested in product short comings and pitfalls when used in
> conjunction with sql server.
> thanks, gigel
>
|||Make sure you understand Service Principle Names (SPNs) and how to set them
manually.
In addition granting the right to set SPNs to the service account running
SQL server.
In some landscapes this AD level permission is not allowed to be set.
Finally if all you are going to do is log ship with it use log shipping.
Joe
"Gigel" wrote:

> has anyone used double-take for high availability solution?
> i am interested in product short comings and pitfalls when used in
> conjunction with sql server.
> thanks, gigel
>
>

double-take for high availability?

has anyone used double-take for high availability solution?
i am interested in product short comings and pitfalls when used in
conjunction with sql server.
thanks, gigelNo Microsoft support...big short-coming.
But I have seen the demos and heard good things about it from the SBS crowd.
:)
--
Kevin3NF
SQL Server dude
You want fries with that?
http://kevin3nf.blogspot.com/
I only check the newsgroups during work hours, M-F.
Hit my blog and the contact links if necessary...I may be available.
"Gigel" <gigel@.microsoft.com> wrote in message
news:eMB8816fIHA.4476@.TK2MSFTNGP06.phx.gbl...
> has anyone used double-take for high availability solution?
> i am interested in product short comings and pitfalls when used in
> conjunction with sql server.
> thanks, gigel
>|||Make sure you understand Service Principle Names (SPNs) and how to set them
manually.
In addition granting the right to set SPNs to the service account running
SQL server.
In some landscapes this AD level permission is not allowed to be set.
Finally if all you are going to do is log ship with it use log shipping.
Joe
"Gigel" wrote:
> has anyone used double-take for high availability solution?
> i am interested in product short comings and pitfalls when used in
> conjunction with sql server.
> thanks, gigel
>
>

Friday, February 17, 2012

Doing a join between XML data typed field and a relational table in Yukon (SQL 2005)

Hello,
I have a Yukon XML question and would be very happy if someone can
assist:
Let's assume I have 2 tables:
One will be product table Regular relational table with Product ID
as a primary key and some descriptive fields.
Second is an Order table it has Order ID as a PK and Order details
which is a field of XML data type and holds all lines in the order
including quantity, product id, prices, etc.
I want to make a join that will present the orders with all product
details for each order line.
Do you know how can I do a Join between XML field and relational
table?
Thanks,
Nitsan
"Nitsan" <nitsan.shaked@.intel.com> wrote in message
news:31b6c8ae.0407120300.6902d2e1@.posting.google.c om...
[snip]
> Do you know how can I do a Join between XML field and relational
> table?
You should be able to do this with the new nesting of FOR XML statements in
Yukon. See:
http://sqljunkies.com/WebLog/mrys/ar...2/19/1208.aspx
Bryant
|||Thanks for your answer,
I looked into it and it looks like it was doing select on relational tables
and just created XML as an answer.
I am looking for the opposite - Query in XML content join relational table
to get data (even not necessarily in XML format).
Thanks,
Nitsan
"Bryant Likes" <bryant@.suespammers.org> wrote in message
news:OeRsQuBaEHA.524@.TK2MSFTNGP09.phx.gbl...
> "Nitsan" <nitsan.shaked@.intel.com> wrote in message
> news:31b6c8ae.0407120300.6902d2e1@.posting.google.c om...
> [snip]
> You should be able to do this with the new nesting of FOR XML statements
in
> Yukon. See:
> http://sqljunkies.com/WebLog/mrys/ar...2/19/1208.aspx
> --
> Bryant
>
|||Even outside of the capabilties of FOR XML, you can do what you want.
You can use a value from the XML data type using the method xmltype.value()
in a SQL predicate. Or you can use the value of a sql:variable or sql:column
to do the join inside an XQuery.
Bob Beauchemin
http://staff.develop.com/bobb
"Nitsan Shaked" <nitsan.shaked@.intel.com> wrote in message
news:ccuhjj$kr2$1@.news01.intel.com...
> Thanks for your answer,
> I looked into it and it looks like it was doing select on relational
tables
> and just created XML as an answer.
> I am looking for the opposite - Query in XML content join relational table
> to get data (even not necessarily in XML format).
> Thanks,
> Nitsan
> "Bryant Likes" <bryant@.suespammers.org> wrote in message
> news:OeRsQuBaEHA.524@.TK2MSFTNGP09.phx.gbl...
> in
>
|||Nitsan,
in SQL Server 2005 Beta 2 or SQL Server 2005 Express Edition Technical
Preview you can use nodes() method on XML type to get a row set out of an
XML instance and then do the join in T-SQL space:
create table products(ProdID int primary key, ProdDesc nvarchar(max))
go
create table orders(OrderID int primary key, OrdDetails xml)
go
insert products values(1, 'Prod1')
insert products values(2, 'Prod2')
go
insert orders values(1,
'<prod id="1">
<quantity>2</quantity>
<price>12345.67</price>
</prod>
<prod id="2">
<quantity>3</quantity>
<price>9876.54</price>
</prod>')
go
select OrderID, quantity, price, ProdDesc
from
(
select
OrderID,
prod.value('./@.id', 'int') as id,
prod.value('(./quantity)[1]', 'int') as quantity,
prod.value('(./price)[1]', 'money') as price
from orders cross apply orders.OrdDetails.nodes('/prod') as prods(prod)
) as OrdLine
join products on OrdLine.id=products.ProdID
go
You can then apply FOR XML to results if you need results as XML.
Regards,
Eugene Kogan,
Technical Lead,
SQL Server Engine
Microsoft Corp
[This posting is provided "AS IS" with no warranties, and confers no
rights.]
"Nitsan" <nitsan.shaked@.intel.com> wrote in message
news:31b6c8ae.0407120300.6902d2e1@.posting.google.c om...
> Hello,
> I have a Yukon XML question and would be very happy if someone can
> assist:
> Let's assume I have 2 tables:
> One will be product table - Regular relational table with Product ID
> as a primary key and some descriptive fields.
> Second is an Order table - it has Order ID as a PK and Order details
> which is a field of XML data type and holds all lines in the order
> including quantity, product id, prices, etc.
> I want to make a join that will present the orders with all product
> details for each order line.
> Do you know how can I do a Join between XML field and relational
> table?
> Thanks,
> Nitsan
|||Thanks,
Do you have a short example if usin git for this purpose?
"Bob Beauchemin" <no_bobb_spam@.develop.com> wrote in message
news:O9D73DEaEHA.3508@.TK2MSFTNGP09.phx.gbl...
> Even outside of the capabilties of FOR XML, you can do what you want.
> You can use a value from the XML data type using the method
xmltype.value()
> in a SQL predicate. Or you can use the value of a sql:variable or
sql:column[vbcol=seagreen]
> to do the join inside an XQuery.
> Bob Beauchemin
> http://staff.develop.com/bobb
>
> "Nitsan Shaked" <nitsan.shaked@.intel.com> wrote in message
> news:ccuhjj$kr2$1@.news01.intel.com...
> tables
table[vbcol=seagreen]
statements
>
|||Thank you very much !!!
"Eugene Kogan" <eugene_kogan@.hotmail.com> wrote in message
news:uUd0kAJaEHA.2520@.TK2MSFTNGP12.phx.gbl...
> Nitsan,
> in SQL Server 2005 Beta 2 or SQL Server 2005 Express Edition Technical
> Preview you can use nodes() method on XML type to get a row set out of an
> XML instance and then do the join in T-SQL space:
> create table products(ProdID int primary key, ProdDesc nvarchar(max))
> go
> create table orders(OrderID int primary key, OrdDetails xml)
> go
> insert products values(1, 'Prod1')
> insert products values(2, 'Prod2')
> go
> insert orders values(1,
> '<prod id="1">
> <quantity>2</quantity>
> <price>12345.67</price>
> </prod>
> <prod id="2">
> <quantity>3</quantity>
> <price>9876.54</price>
> </prod>')
> go
> select OrderID, quantity, price, ProdDesc
> from
> (
> select
> OrderID,
> prod.value('./@.id', 'int') as id,
> prod.value('(./quantity)[1]', 'int') as quantity,
> prod.value('(./price)[1]', 'money') as price
> from orders cross apply orders.OrdDetails.nodes('/prod') as prods(prod)
> ) as OrdLine
> join products on OrdLine.id=products.ProdID
> go
> You can then apply FOR XML to results if you need results as XML.
>
> Regards,
> Eugene Kogan,
> Technical Lead,
> SQL Server Engine
> Microsoft Corp
> [This posting is provided "AS IS" with no warranties, and confers no
> rights.]
> "Nitsan" <nitsan.shaked@.intel.com> wrote in message
> news:31b6c8ae.0407120300.6902d2e1@.posting.google.c om...
>
|||Hi Nitsan,
Here's a really short example, starting with the authors table in the pubs
database:
create table xmlauth (
authbio xml)
go
insert xmlauth values('<author id="172-32-1176"><hobbies><golf score="78"
/><tennis/></hobbies></author>')
insert xmlauth values('<author id="213-46-8915"><hobbies><golf score="82"
/><bowling/></hobbies></author>')
If you know each document contains one author, you can use xml.value:
select authbio.query('/author/hobbies/*') as hobbies, au_lname
from authors, xmlauth
where authors.au_id =
xmlauth.authbio.value('author[1]/@.id', 'varchar(11)')
(if you have a schema collection which specifies a single author occurance,
you can leave out the subscript [1] in the value subquery)
If documents may contain more than one author, (e.g)
insert xmlauth values('
<authors>
<author id="274-80-9391"><hobbies><swimming
/><bowling/></hobbies></author>
<author id="274-80-9391"><hobbies><baseball
/><bowling/></hobbies></author>
</authors>')
you would need xml.nodes. Eugene's excellent example illustrates that.
You can even do this (caution: NOT recommended, cartesian product) using the
SQL value in the XQuery:
select * from
(
select authbio.query('
for $a in /author
where $a/@.id = sql:column("authors.au_id")
return $a/hobbies/*') as hobbies, au_lname
from xmlauth, authors
) as a
where hobbies.exist('/*')=1
or
select * from
(
select authbio.query('
for $a in /author
where $a/@.id = sql:column("authors.au_id")
return $a/hobbies/*') as hobbies, au_lname
from xmlauth, authors
) as a
where convert(nvarchar(100), hobbies) <> ''
Hope this helps,
Bob Beauchemin
http://staff.develop.com/bobb
"Nitsan Shaked" <nitsan.shaked@.intel.com> wrote in message
news:cd034u$fo8$1@.news01.intel.com...
> Thanks,
> Do you have a short example if usin git for this purpose?
> "Bob Beauchemin" <no_bobb_spam@.develop.com> wrote in message
> news:O9D73DEaEHA.3508@.TK2MSFTNGP09.phx.gbl...
> xmltype.value()
> sql:column
> table
> statements
>