vw_ProductMerchandiseHierarchy View

<< Click to Display Table of Contents >>

Navigation:  iVend Database Database > Views >

vw_ProductMerchandiseHierarchy View

Navigation: iVend Database Database > Views >

hm_btn_navigate_prevhm_btn_navigate_tophm_btn_navigate_next

iVend 6.6 Database Help

vw_ProductMerchandiseHierarchy View

Collapse All Expand All

iVend Database Database : vw_ProductMerchandiseHierarchy View

Properties

Creation Date

4/13/2015 12:00 PM

Is Schema Bound

dbimages_boolean-false

Encrypted

dbimages_boolean-false

Ansi Nulls

dbimages_boolean-true

Columns

 

Column Name

Description

Datatype

Length

Allow Nulls

Default

Formula

 

ProductKey

 

BigInt

8

 

 

 

 

HierarchyKey

 

BigInt

8

dbimages_tick

 

 

 

Level1

 

VarWChar

50

dbimages_tick

 

 

 

Level2

 

VarWChar

50

dbimages_tick

 

 

 

Level3

 

VarWChar

50

dbimages_tick

 

 

 

Level4

 

VarWChar

50

dbimages_tick

 

 

 

Level5

 

VarWChar

50

dbimages_tick

 

 

 

Level6

 

VarWChar

50

dbimages_tick

 

 

 

Level7

 

VarWChar

50

dbimages_tick

 

 

 

Level8

 

VarWChar

50

dbimages_tick

 

 

 

Level9

 

VarWChar

50

dbimages_tick

 

 

 

Level10

 

VarWChar

50

dbimages_tick

 

 

 

Level11

 

VarWChar

50

dbimages_tick

 

 

 

Level12

 

VarWChar

50

dbimages_tick

 

 

 

Level13

 

VarWChar

50

dbimages_tick

 

 

 

Level14

 

VarWChar

50

dbimages_tick

 

 

 

Level15

 

VarWChar

50

dbimages_tick

 

 

Objects that depend on vw_ProductMerchandiseHierarchy

 

Database Object

Object Type

Description

Dep Level

vwAnalytics_MerchandisePromotionSales view

vwAnalytics_MerchandisePromotionSales

View

 

1

vwAnalytics_MerchandiseSales view

vwAnalytics_MerchandiseSales

View

 

1

vwAnalytics_NetSales view

vwAnalytics_NetSales

View

 

1

Objects that vw_ProductMerchandiseHierarchy depends on

 

Database Object

Object Type

Description

Dep Level

InvMerchandiseHierarchyDetail table

InvMerchandiseHierarchyDetail

Table

Detail table for saving the merchandise Hierarch tree details.

1

InvProduct table

InvProduct

Table

Stores the product related details.

1

InvProductMerchandiseHierarchy table

InvProductMerchandiseHierarchy

Table

Stores the values related to a defined Merchandise hirarchy for a product

1

View Definition

CREATE View [dbo].[vw_ProductMerchandiseHierarchy]

As

With CTE

As

(

Select InvProduct.ProductKey, InvProductMerchandiseHierarchy.HierarchyKey, InvMerchandiseHierarchyDetail.Name, InvMerchandiseHierarchyDetail.ParentNodeKey, InvMerchandiseHierarchyDetail.HierarchyLevel

From InvProduct Inner Join InvProductMerchandiseHierarchy On InvProduct.ProductKey = InvProductMerchandiseHierarchy.ProductKey

    Inner Join InvMerchandiseHierarchyDetail On InvProductMerchandiseHierarchy.HierarchyDetailKey = InvMerchandiseHierarchyDetail.HierarchyDetailKey

Union All

Select CTE.ProductKey, CTE.HierarchyKey, InvMerchandiseHierarchyDetail.Name, InvMerchandiseHierarchyDetail.ParentNodeKey, InvMerchandiseHierarchyDetail.HierarchyLevel

From InvMerchandiseHierarchyDetail Inner Join CTE On InvMerchandiseHierarchyDetail.HierarchyDetailKey = CTE.ParentNodeKey

)

Select *

From (

  Select InvProduct.ProductKey, HierarchyKey, Name, HierarchyLevel='Level' + Cast(HierarchyLevel as varchar(2))

  From InvProduct Left Outer Join CTE On InvProduct.ProductKey = CTE.ProductKey

  ) As temp

PIVOT

(

Max(Name)

FOR [HierarchyLevel] IN (Level1,Level2,Level3,Level4,Level5,Level6,Level7,Level8,Level9,Level10,Level11,Level12,Level13,Level14,Level15)

)AS RESULT

See Also

Related Objects

iVend Database Database

 

 


© 2019 All Rights Reserved.

Send comments on this topic.