Quantcast
Channel: SQL Server Analysis Services forum
Viewing all articles
Browse latest Browse all 14337

Flatten table (Ragged into Balanced Hierarchy)

$
0
0

Hi,

I've flattened parent-child table and got the levels like below example

E.g.:

lvl5

lvl4

lvl3

lvl2

lvl1

lvl0

ZZZ

AAA

CCC

104

Null

Null

ZZZ

AAA

DDD

EEE

FFF

105

ZZZ

BBB

103

Null

Null

Null

ZZZ

101

Null

Null

Null

Null

ZZZ

102

Null

Null

Null

Null

But, here I would like to move all the leaf nodes in to lvl 0 like below example

E.g.:

lvl5

lvl4

lvl3

lvl2

lvl1

lvl0

ZZZ

AAA

CCC

Null

Null

104

ZZZ

AAA

DDD

EEE

FFF

105

ZZZ

BBB

Null

Null

Null

103

ZZZ

Null

Null

Null

Null

101

ZZZ

Null

Null

Null

Null

102

After doing this table need to replace null into their respective parent like below example

E.g.:

lvl5

lvl4

lvl3

lvl2

lvl1

lvl0

ZZZ

AAA

CCC

CCC

CCC

104

ZZZ

AAA

DDD

EEE

FFF

105

ZZZ

BBB

BBB

BBB

BBB

103

ZZZ

ZZZ

ZZZ

ZZZ

ZZZ

101

ZZZ

ZZZ

ZZZ

ZZZ

ZZZ

102

By using some properties in SSAS we can remove duplicates of parents and can create Balanced Hierarchy.

Reply should be like a life saviour and should be appreciated.

Thanks,

Munna


Viewing all articles
Browse latest Browse all 14337

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>