Showing posts with label tree. Show all posts
Showing posts with label tree. Show all posts

Tuesday, March 20, 2012

A tree of location and site names..

Hello,
This is a tuff one not sure if it can be done with an SQL query, I'm
thinking along the lines of an inner join, but I'm not really sure.
I have a table that is used to refer to location_names as nodes and sites as
the leaf nodes it is the site names that I want to return based on a join to
another table using the SiteFK column.
TABLE: TRS_SiteTree
SiteTreePK ParentFK Name SiteFK Path
1 0 All 0
0
2 1 South 0
0.0
3 1 North 0
0.1
4 2 Oxfordshire 0
0.0.0
5 4 Witney 1
0.0.0.0
6 4 Banbury 2
0.0.0.1
7 3 Teeside 0
0.1.0
8 7 Yarm 3
0.1.0.0
9 4 Oxford 4
0.0.0.2
10 3 Yorkshire 5
0.1.1
The SiteFK indicates if the site is a leaf node if it is <> 0 otherwise a
parent
The Path indicates the level of nesting
The leaf node Yorkshire has a parentFK of 3 which matches to the SiteTreePK
of 3 which subsequently has a Parent FK of 1 and a location of North which
sits under All where the Parent FK matches with the SiteTreePK of 1 All.
An illustration of the tree that the table represents:
0 All
|_____0.0 South
| |______0.0.0 Oxfordshire
| |_________ 0.0.0.0 Witney
(leaf 1)
| |_________ 0.0.0.1 Banbury
(leaf 2)
| |_________ 0.0.0.2 Oxford
(leaf 4)
|_____ 0.1 North
|______ 0.1.0 Teeside
| |_________ 0.1.0.0 Yarm (leaf
3)
|______ 0.1.1 Yorkshire (leaf 5)
if you have any suggestions on where I might start with this task this would
be muchly appreciated even if it's just a few ideas to try out.
Thank you kindly
Rhonda
ooops, I mean a self join
"Rhonda Fischer" wrote:

> Hello,
> This is a tuff one not sure if it can be done with an SQL query, I'm
> thinking along the lines of an inner join, but I'm not really sure.
> I have a table that is used to refer to location_names as nodes and sites as
> the leaf nodes it is the site names that I want to return based on a join to
> another table using the SiteFK column.
> TABLE: TRS_SiteTree
> SiteTreePK ParentFK Name SiteFK Path
> 1 0 All 0
> 0
> 2 1 South 0
> 0.0
> 3 1 North 0
> 0.1
> 4 2 Oxfordshire 0
> 0.0.0
> 5 4 Witney 1
> 0.0.0.0
> 6 4 Banbury 2
> 0.0.0.1
> 7 3 Teeside 0
> 0.1.0
> 8 7 Yarm 3
> 0.1.0.0
> 9 4 Oxford 4
> 0.0.0.2
> 10 3 Yorkshire 5
> 0.1.1
> The SiteFK indicates if the site is a leaf node if it is <> 0 otherwise a
> parent
> The Path indicates the level of nesting
> The leaf node Yorkshire has a parentFK of 3 which matches to the SiteTreePK
> of 3 which subsequently has a Parent FK of 1 and a location of North which
> sits under All where the Parent FK matches with the SiteTreePK of 1 All.
> An illustration of the tree that the table represents:
> 0 All
> |_____0.0 South
> | |______0.0.0 Oxfordshire
> | |_________ 0.0.0.0 Witney
> (leaf 1)
> | |_________ 0.0.0.1 Banbury
> (leaf 2)
> | |_________ 0.0.0.2 Oxford
> (leaf 4)
> |_____ 0.1 North
> |______ 0.1.0 Teeside
> | |_________ 0.1.0.0 Yarm (leaf
> 3)
> |______ 0.1.1 Yorkshire (leaf 5)
> if you have any suggestions on where I might start with this task this would
> be muchly appreciated even if it's just a few ideas to try out.
> Thank you kindly
> Rhonda
>
|||On Fri, 13 May 2005 08:22:02 -0700, Rhonda Fischer wrote:

>Hello,
>This is a tuff one not sure if it can be done with an SQL query, I'm
>thinking along the lines of an inner join, but I'm not really sure.
(snip)
Hi Rhonda,
Sorry for the late reply.
I'm not sure what exactly you're asking. Your message doesn't appear to
have any specific question. Are you looking for generic advice if your
solution is the best one for your problem? Or do you actually need a
query to do a specific job?
In the latter case, please repost. I'd appreciate it if you'd post the
table structure as a CREATE TABLE statement (including all constraints
and properties - any irrelevant columns may be left out, though) and the
sample data as INSERT statements. Also, post the output you'd like to
get from the sameple data.
Check www.aspfaq.com/5006 for some useful hints on how to post.
If you're looking for generic advice on how to deal with hierarchies,
then your best bet is to buy and read "Trees and Hierarchies in SQL" by
Joe Celko. This book describes several ways to model a hierarchy in SQL,
with their pros and cons.
You could also google for "nested sets model" and "adjacency list model"
to find information about two of the most common ways to represent a
hierarchy.
Best, Hugo
(Remove _NO_ and _SPAM_ to get my e-mail address)
|||Dear Hugo,
Thank you very much for your considered thought on my questions. Your
thoughts and suggested reference material were helpful to draw this to a
resolution.
Thank you again
Cheerio
Rhonda
"Hugo Kornelis" wrote:

> On Fri, 13 May 2005 08:22:02 -0700, Rhonda Fischer wrote:
> (snip)
> Hi Rhonda,
> Sorry for the late reply.
> I'm not sure what exactly you're asking. Your message doesn't appear to
> have any specific question. Are you looking for generic advice if your
> solution is the best one for your problem? Or do you actually need a
> query to do a specific job?
> In the latter case, please repost. I'd appreciate it if you'd post the
> table structure as a CREATE TABLE statement (including all constraints
> and properties - any irrelevant columns may be left out, though) and the
> sample data as INSERT statements. Also, post the output you'd like to
> get from the sameple data.
> Check www.aspfaq.com/5006 for some useful hints on how to post.
> If you're looking for generic advice on how to deal with hierarchies,
> then your best bet is to buy and read "Trees and Hierarchies in SQL" by
> Joe Celko. This book describes several ways to model a hierarchy in SQL,
> with their pros and cons.
> You could also google for "nested sets model" and "adjacency list model"
> to find information about two of the most common ways to represent a
> hierarchy.
> Best, Hugo
> --
> (Remove _NO_ and _SPAM_ to get my e-mail address)
>

Saturday, February 25, 2012

A question related to stored procedure

Suppose there is a database table which contains information of a
complete binary tree.
A complete binary tree is always populated depth wise. A certain level
is filled up completely before going further level
down.
The table contains sequential information of the tree. As shown in the
following, the table on the right contains the tree information on the
left after inserting 4 nodes.
ID Name tree
1 N0 N0
2 N1
N1 N2
3 N2
And after inserting 4 nodes the table becomes as below.
ID Name Tree
1 N0 N0
2 N1 N1 N2
3 N2 N3
4 N3
Given a table containing the node information (the number of nodes is
arbitrary) of a complete binary tree as above.
A stored procedure have to write to construct and print a table,
where
the names of the nodes will appear in different rows and
columns of
the table and
the total arrangement will appear like a binary tree of the
following figure.
N0
N1 N2
N3
N4 N5 N6
N7 N8
Hi
"babu" wrote:

> Suppose there is a database table which contains information of a
> complete binary tree.
> A complete binary tree is always populated depth wise. A certain level
> is filled up completely before going further level
> down.
> The table contains sequential information of the tree. As shown in the
> following, the table on the right contains the tree information on the
> left after inserting 4 nodes.
> ID Name tree
> 1 N0 N0
> 2 N1
> N1 N2
> 3 N2
> And after inserting 4 nodes the table becomes as below.
> ID Name Tree
> 1 N0 N0
> 2 N1 N1 N2
> 3 N2 N3
> 4 N3
> Given a table containing the node information (the number of nodes is
> arbitrary) of a complete binary tree as above.
> A stored procedure have to write to construct and print a table,
> where
> · the names of the nodes will appear in different rows and
> columns of
> the table and
> · the total arrangement will appear like a binary tree of the
> following figure.
> N0
> N1 N2
> N3
> N4 N5 N6
> N7 N8
>
Printing is a function for the client to deal with not SQL Server. How you
store and return the hierarchy/tree from SQL Server depends on the model you
are using e.g. nested set or adjacency. Joe Celko's Trees and Hierarchies
book ISBN 1-55860-920-2 (and there are plenty of posts on this!) will give
you some background on this. SQL Server 2005 has the ability for recursive
queries using CTEs which can be ustilised to traverse your hierarchy if you
are using this version.
John
|||I believe one or more of Itzik Ben-Gan's books cover trees/graphs as well.
Very good reads.
TheSQLGuru
President
Indicium Resources, Inc.
"babu" <nasif4003@.gmail.com> wrote in message
news:1179497643.034074.249710@.p77g2000hsh.googlegr oups.com...
Suppose there is a database table which contains information of a
complete binary tree.
A complete binary tree is always populated depth wise. A certain level
is filled up completely before going further level
down.
The table contains sequential information of the tree. As shown in the
following, the table on the right contains the tree information on the
left after inserting 4 nodes.
ID Name tree
1 N0 N0
2 N1
N1 N2
3 N2
And after inserting 4 nodes the table becomes as below.
ID Name Tree
1 N0 N0
2 N1 N1 N2
3 N2 N3
4 N3
Given a table containing the node information (the number of nodes is
arbitrary) of a complete binary tree as above.
A stored procedure have to write to construct and print a table,
where
the names of the nodes will appear in different rows and
columns of
the table and
the total arrangement will appear like a binary tree of the
following figure.
N0
N1 N2
N3
N4 N5 N6
N7 N8

A question related to stored procedure

Suppose there is a database table which contains information of a
complete binary tree.
A complete binary tree is always populated depth wise. A certain level
is filled up completely before going further level
down.
The table contains sequential information of the tree. As shown in the
following, the table on the right contains the tree information on the
left after inserting 4 nodes.
ID Name tree
1 N0 N0
2 N1
N1 N2
3 N2
And after inserting 4 nodes the table becomes as below.
ID Name Tree
1 N0 N0
2 N1 N1 N2
3 N2 N3
4 N3
Given a table containing the node information (the number of nodes is
arbitrary) of a complete binary tree as above.
A stored procedure have to write to construct and print a table,
where
=B7 the names of the nodes will appear in different rows and
columns of
the table and
=B7 the total arrangement will appear like a binary tree of the
following figure.
N0
=20
N1 N2
N3
N4 N5 N6
N7 N8Hi
"babu" wrote:

> Suppose there is a database table which contains information of a
> complete binary tree.
> A complete binary tree is always populated depth wise. A certain level
> is filled up completely before going further level
> down.
> The table contains sequential information of the tree. As shown in the
> following, the table on the right contains the tree information on the
> left after inserting 4 nodes.
> ID Name tree
> 1 N0 N0
> 2 N1
> N1 N2
> 3 N2
> And after inserting 4 nodes the table becomes as below.
> ID Name Tree
> 1 N0 N0
> 2 N1 N1 N2
> 3 N2 N3
> 4 N3
> Given a table containing the node information (the number of nodes is
> arbitrary) of a complete binary tree as above.
> A stored procedure have to write to construct and print a table,
> where
> · the names of the nodes will appear in different rows and
> columns of
> the table and
> · the total arrangement will appear like a binary tree of the
> following figure.
> N0
> N1 N2
> N3
> N4 N5 N6
> N7 N8
>
Printing is a function for the client to deal with not SQL Server. How you
store and return the hierarchy/tree from SQL Server depends on the model you
are using e.g. nested set or adjacency. Joe Celko's Trees and Hierarchies
book ISBN 1-55860-920-2 (and there are plenty of posts on this!) will give
you some background on this. SQL Server 2005 has the ability for recursive
queries using CTEs which can be ustilised to traverse your hierarchy if you
are using this version.
John|||I believe one or more of Itzik Ben-Gan's books cover trees/graphs as well.
Very good reads.
TheSQLGuru
President
Indicium Resources, Inc.
"babu" <nasif4003@.gmail.com> wrote in message
news:1179497643.034074.249710@.p77g2000hsh.googlegroups.com...
Suppose there is a database table which contains information of a
complete binary tree.
A complete binary tree is always populated depth wise. A certain level
is filled up completely before going further level
down.
The table contains sequential information of the tree. As shown in the
following, the table on the right contains the tree information on the
left after inserting 4 nodes.
ID Name tree
1 N0 N0
2 N1
N1 N2
3 N2
And after inserting 4 nodes the table becomes as below.
ID Name Tree
1 N0 N0
2 N1 N1 N2
3 N2 N3
4 N3
Given a table containing the node information (the number of nodes is
arbitrary) of a complete binary tree as above.
A stored procedure have to write to construct and print a table,
where
the names of the nodes will appear in different rows and
columns of
the table and
the total arrangement will appear like a binary tree of the
following figure.
N0
N1 N2
N3
N4 N5 N6
N7 N8

A question related to stored procedure

Suppose there is a database table which contains information of a
complete binary tree.
A complete binary tree is always populated depth wise. A certain level
is filled up completely before going further level
down.
The table contains sequential information of the tree. As shown in the
following, the table on the right contains the tree information on the
left after inserting 4 nodes.
ID Name tree
1 N0 N0
2 N1
N1 N2
3 N2
And after inserting 4 nodes the table becomes as below.
ID Name Tree
1 N0 N0
2 N1 N1 N2
3 N2 N3
4 N3
Given a table containing the node information (the number of nodes is
arbitrary) of a complete binary tree as above.
A stored procedure have to write to construct and print a table,
where
=B7 the names of the nodes will appear in different rows and
columns of
the table and
=B7 the total arrangement will appear like a binary tree of the
following figure.
N0
N1 N2
N3
N4 N5 N6
N7 N8Hi
"babu" wrote:
> Suppose there is a database table which contains information of a
> complete binary tree.
> A complete binary tree is always populated depth wise. A certain level
> is filled up completely before going further level
> down.
> The table contains sequential information of the tree. As shown in the
> following, the table on the right contains the tree information on the
> left after inserting 4 nodes.
> ID Name tree
> 1 N0 N0
> 2 N1
> N1 N2
> 3 N2
> And after inserting 4 nodes the table becomes as below.
> ID Name Tree
> 1 N0 N0
> 2 N1 N1 N2
> 3 N2 N3
> 4 N3
> Given a table containing the node information (the number of nodes is
> arbitrary) of a complete binary tree as above.
> A stored procedure have to write to construct and print a table,
> where
> · the names of the nodes will appear in different rows and
> columns of
> the table and
> · the total arrangement will appear like a binary tree of the
> following figure.
> N0
> N1 N2
> N3
> N4 N5 N6
> N7 N8
>
Printing is a function for the client to deal with not SQL Server. How you
store and return the hierarchy/tree from SQL Server depends on the model you
are using e.g. nested set or adjacency. Joe Celko's Trees and Hierarchies
book ISBN 1-55860-920-2 (and there are plenty of posts on this!) will give
you some background on this. SQL Server 2005 has the ability for recursive
queries using CTEs which can be ustilised to traverse your hierarchy if you
are using this version.
John|||I believe one or more of Itzik Ben-Gan's books cover trees/graphs as well.
Very good reads.
--
TheSQLGuru
President
Indicium Resources, Inc.
"babu" <nasif4003@.gmail.com> wrote in message
news:1179497643.034074.249710@.p77g2000hsh.googlegroups.com...
Suppose there is a database table which contains information of a
complete binary tree.
A complete binary tree is always populated depth wise. A certain level
is filled up completely before going further level
down.
The table contains sequential information of the tree. As shown in the
following, the table on the right contains the tree information on the
left after inserting 4 nodes.
ID Name tree
1 N0 N0
2 N1
N1 N2
3 N2
And after inserting 4 nodes the table becomes as below.
ID Name Tree
1 N0 N0
2 N1 N1 N2
3 N2 N3
4 N3
Given a table containing the node information (the number of nodes is
arbitrary) of a complete binary tree as above.
A stored procedure have to write to construct and print a table,
where
· the names of the nodes will appear in different rows and
columns of
the table and
· the total arrangement will appear like a binary tree of the
following figure.
N0
N1 N2
N3
N4 N5 N6
N7 N8

Friday, February 24, 2012

A query where two tables are linked to the same another table

Hello,

I'm not an expert in SQL, if you could help me for that little
problem:

I had tree simple tables with their fields:
[Client] IdClient, Param
[Sale] IdSale, IdClient, Param
[Param] IdParam, Value

How can I retrieve a recordset with this columns ?
IdClient, IdSale, ValueOfParamClient, ValueOfParamSale

The problem is that I can retrieve a Param for one table (Client or
Sale) like this request :

SELECT Client.IdClient, Sale.IdSale, Param.Value
FROM
(Client
INNER JOIN Sale
ON Sale.IdClient = Client.IdClient)
LEFT JOIN Param
ON Param.IdParam = Sale.Param

But how can I retrieve the Param of the another table in a simple
query ? (because I would also like that it works for access)

Thank for your help,

Marc"Marc" <pasdespam@.free.fr> wrote in message
news:pk2fu093c78fdmofrln1p3js488e7fkqn7@.4ax.com...
> Hello,
> I'm not an expert in SQL, if you could help me for that little
> problem:
> I had tree simple tables with their fields:
> [Client] IdClient, Param
> [Sale] IdSale, IdClient, Param
> [Param] IdParam, Value
> How can I retrieve a recordset with this columns ?
> IdClient, IdSale, ValueOfParamClient, ValueOfParamSale
> The problem is that I can retrieve a Param for one table (Client or
> Sale) like this request :
> SELECT Client.IdClient, Sale.IdSale, Param.Value
> FROM
> (Client
> INNER JOIN Sale
> ON Sale.IdClient = Client.IdClient)
> LEFT JOIN Param
> ON Param.IdParam = Sale.Param
> But how can I retrieve the Param of the another table in a simple
> query ? (because I would also like that it works for access)
> Thank for your help,
> Marc

It's not really clear - at least to me - what you're trying to do. It would
be best to post CREATE TABLE and INSERT statements to set up a test case,
along with the results you expect, as that will avoid confusion.

http://www.aspfaq.com/etiquette.asp?id=5006

Simon|||On Fri, 14 Jan 2005 10:26:16 +0100, Marc wrote:

>Hello,
>I'm not an expert in SQL, if you could help me for that little
>problem:
>I had tree simple tables with their fields:
>[Client] IdClient, Param
>[Sale] IdSale, IdClient, Param
>[Param] IdParam, Value
>How can I retrieve a recordset with this columns ?
>IdClient, IdSale, ValueOfParamClient, ValueOfParamSale
>The problem is that I can retrieve a Param for one table (Client or
>Sale) like this request :
>SELECT Client.IdClient, Sale.IdSale, Param.Value
>FROM
>(Client
>INNER JOIN Sale
>ON Sale.IdClient = Client.IdClient)
>LEFT JOIN Param
>ON Param.IdParam = Sale.Param
>But how can I retrieve the Param of the another table in a simple
>query ? (because I would also like that it works for access)

Hi Marc,

Something like this maybe?

SELECT C.IdClient, S.IdSale, PC.Value, PS.Value
FROM Client AS C
INNER JOIN Sale AS S
ON S.IdClient = C.IdClient
INNER JOIN Param AS PC
ON PC.IdParam = C.Param
INNER JOIN Param AS PS
ON PS.IdParam = S.Param

(untested)

Best, Hugo
--

(Remove _NO_ and _SPAM_ to get my e-mail address)|||On Fri, 14 Jan 2005 12:10:39 +0100, Hugo Kornelis
<hugo@.pe_NO_rFact.in_SPAM_fo> wrote:

>On Fri, 14 Jan 2005 10:26:16 +0100, Marc wrote:
>>
>>Hello,
>>
>>I'm not an expert in SQL, if you could help me for that little
>>problem:
>>
>>I had tree simple tables with their fields:
>>[Client] IdClient, Param
>>[Sale] IdSale, IdClient, Param
>>[Param] IdParam, Value
>>
>>How can I retrieve a recordset with this columns ?
>>IdClient, IdSale, ValueOfParamClient, ValueOfParamSale
>>
>>The problem is that I can retrieve a Param for one table (Client or
>>Sale) like this request :
>>
>>SELECT Client.IdClient, Sale.IdSale, Param.Value
>>FROM
>>(Client
>>INNER JOIN Sale
>>ON Sale.IdClient = Client.IdClient)
>>LEFT JOIN Param
>>ON Param.IdParam = Sale.Param
>>
>>But how can I retrieve the Param of the another table in a simple
>>query ? (because I would also like that it works for access)
>Hi Marc,
>Something like this maybe?
>SELECT C.IdClient, S.IdSale, PC.Value, PS.Value
>FROM Client AS C
>INNER JOIN Sale AS S
> ON S.IdClient = C.IdClient
>INNER JOIN Param AS PC
> ON PC.IdParam = C.Param
>INNER JOIN Param AS PS
> ON PS.IdParam = S.Param
>(untested)
>Best, Hugo

Thanks very much Hugo !
I can only test on access today and it works with a few changes (I'll
test later on SqlServer)

For information, the code that works with access :
SELECT Client.IdClient, Sale.IdSale, PC.Value, PS.Value
FROM ((Client
INNER JOIN Sale
ON Sale.IdClient = Client.IdClient)
INNER JOIN Param AS PC
ON PC.IdParam = Client.Param)
INNER JOIN Param AS PS
ON PS.IdParam = Sale.Param

Marc|||You also need to alias your columns:

SELECT Client.IdClient, Sale.IdSale, PC.Value AS PC_Param_Value, PS.Value
as AS PS_Param_Value
FROM ((Client
INNER JOIN Sale
ON Sale.IdClient = Client.IdClient)
INNER JOIN Param AS PC
ON PC.IdParam = Client.Param)
INNER JOIN Param AS PS
ON PS.IdParam = Sale.Param

This gives you the ability to differentiate between the vaues when you are
using the result set.

--
-----------------------
Louis Davidson - drsql@.hotmail.com
SQL Server MVP

Compass Technology Management - www.compass.net
Pro SQL Server 2000 Database Design -
http://www.apress.com/book/bookDisplay.html?bID=266
Note: Please reply to the newsgroups only unless you are interested in
consulting services. All other replies may be ignored :)

"Marc" <pasdespam@.free.fr> wrote in message
news:o6cfu010dk470erscujk550m2n43jmsdk8@.4ax.com...
> On Fri, 14 Jan 2005 12:10:39 +0100, Hugo Kornelis
> <hugo@.pe_NO_rFact.in_SPAM_fo> wrote:
>>On Fri, 14 Jan 2005 10:26:16 +0100, Marc wrote:
>>
>>>
>>>Hello,
>>>
>>>I'm not an expert in SQL, if you could help me for that little
>>>problem:
>>>
>>>I had tree simple tables with their fields:
>>>[Client] IdClient, Param
>>>[Sale] IdSale, IdClient, Param
>>>[Param] IdParam, Value
>>>
>>>How can I retrieve a recordset with this columns ?
>>>IdClient, IdSale, ValueOfParamClient, ValueOfParamSale
>>>
>>>The problem is that I can retrieve a Param for one table (Client or
>>>Sale) like this request :
>>>
>>>SELECT Client.IdClient, Sale.IdSale, Param.Value
>>>FROM
>>>(Client
>>>INNER JOIN Sale
>>>ON Sale.IdClient = Client.IdClient)
>>>LEFT JOIN Param
>>>ON Param.IdParam = Sale.Param
>>>
>>>But how can I retrieve the Param of the another table in a simple
>>>query ? (because I would also like that it works for access)
>>
>>Hi Marc,
>>
>>Something like this maybe?
>>
>>SELECT C.IdClient, S.IdSale, PC.Value, PS.Value
>>FROM Client AS C
>>INNER JOIN Sale AS S
>> ON S.IdClient = C.IdClient
>>INNER JOIN Param AS PC
>> ON PC.IdParam = C.Param
>>INNER JOIN Param AS PS
>> ON PS.IdParam = S.Param
>>
>>(untested)
>>
>>Best, Hugo
> Thanks very much Hugo !
> I can only test on access today and it works with a few changes (I'll
> test later on SqlServer)
> For information, the code that works with access :
> SELECT Client.IdClient, Sale.IdSale, PC.Value, PS.Value
> FROM ((Client
> INNER JOIN Sale
> ON Sale.IdClient = Client.IdClient)
> INNER JOIN Param AS PC
> ON PC.IdParam = Client.Param)
> INNER JOIN Param AS PS
> ON PS.IdParam = Sale.Param
> Marc

Saturday, February 11, 2012

a key time as a split variable in Microsoft Time Series?

Hello,

I was working with Microsoft Time Series model (MTS) with some data, when in the mining model viewer, decision tree tab, I realized that the key time variable that I define, it was acting like a split variable.

So, I ask you, this is possible?, because, for me, this should not happen….

After, I review the Data Mining Tutorial by Seth Paul, Jamie MacLennan, Zhaohui Tang and Scott Oveson, and I found, in the Forecasting part, that the key time variable (Time Index) it was acting like a split variable too, in for example, M200 pacific:Quantity and R250 Europe:Quantity.

So people, it’s possible that a key time variable act like a split variable in a MTS model?

Thanks

This is by design. Imagine you have a series that behaves in a certain manner, then at some time, the behavior changes radically - possibly due to some external event not captured in your data. Since the Time Series prediction always occurs in the future, splitting on time allows us to isolate and describe that past behavior without averaging out that behavior into your current predictions. If your series was mostly increasing or decreasing, this would manifest itself naturally in a split like (t-2)>70, however, if your series is mostly stationary, such a split wouldn't make sense.

The implementation is that we add a monotonically increasing series that is only used as a split candidate and not as a regression candidate.