dbTalk Databases Forums  

Select a deepest level with varibale sub levels (part2)

microsoft.public.sqlserver.olap microsoft.public.sqlserver.olap


Discuss Select a deepest level with varibale sub levels (part2) in the microsoft.public.sqlserver.olap forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Stanley
 
Posts: n/a

Default Select a deepest level with varibale sub levels (part2) - 12-16-2004 , 07:39 AM






Hi,

I'm posting again because i accidentally pressed the post button.

I have a dimension with the following levels:

Perspective1
KPI1
UnitA
UnitB
UnitC
KPI2
UnitA
UnitB
UnitC
Perspective2
KPI1
UnitA
UnitB
UnitC
KPI2
UnitA
UnitB
UnitC
Etc.....

In my SQL Report i want to create a parameter where i can select t he Unit.
The report should return all the levels concerning that specific Unit. So if
i select UnitB, i should get:

Perspective1
KPI1
UnitB
KPI2
UnitB
Perspective2
KPI1
UnitB
KPI2
UnitB

I know you can do something like:
[All Perspective].[KPI].members
to get all the Units.
But now i want only one unit with all the KPIs. Is this possible?

Probably you would say to rearrange my cube and dimensions, but i already
did(because of another 'problem') and came up with this version. So, if it's
not possible than i will go back to my previous design, because basically
this design works best for me .

Thnx,

Stanley

Reply With Quote
  #2  
Old   
Brian Altmann
 
Posts: n/a

Default RE: Select a deepest level with varibale sub levels (part2) - 12-16-2004 , 09:19 AM






Maybe this Foodmart query might help:

select
{[Measures].[Unit Sales]} on columns,
hierarchize(generate ( filter([Product Name].members,
right(product.currentmember.name,10)="Light Beer"),
ascendants(product.currentmember))) on rows
from Sales

Instead of

right(product.currentmember.name,10)="Light Beer"

you could use something like:

[Your dimension].currentmember.name="UnitB"

HTH,
Brian
www.geocities.com/brianaltmann/olap.html

"Stanley" wrote:

Quote:
Hi,

I'm posting again because i accidentally pressed the post button.

I have a dimension with the following levels:

Perspective1
KPI1
UnitA
UnitB
UnitC
KPI2
UnitA
UnitB
UnitC
Perspective2
KPI1
UnitA
UnitB
UnitC
KPI2
UnitA
UnitB
UnitC
Etc.....

In my SQL Report i want to create a parameter where i can select t he Unit.
The report should return all the levels concerning that specific Unit. So if
i select UnitB, i should get:

Perspective1
KPI1
UnitB
KPI2
UnitB
Perspective2
KPI1
UnitB
KPI2
UnitB

I know you can do something like:
[All Perspective].[KPI].members
to get all the Units.
But now i want only one unit with all the KPIs. Is this possible?

Probably you would say to rearrange my cube and dimensions, but i already
did(because of another 'problem') and came up with this version. So, if it's
not possible than i will go back to my previous design, because basically
this design works best for me .

Thnx,

Stanley

Reply With Quote
  #3  
Old   
Stanley
 
Posts: n/a

Default RE: Select a deepest level with varibale sub levels (part2) - 12-16-2004 , 10:23 AM



Hi Brian,

This helped some. I did get the KPIs of a certain Unit, but the outcome of
the query gives me the whole hierarchy,like when i filter on UnitA:

Perspective1
Perspective1 - KPI1
Perspective1 - KPI1 - UnitA
Kpi2 - UnitA
Perspective2 - KPI1
Perspective2 - KPI1 - UnitA
KPI2 - UnitA

I would like to have the lowest level only:

Perspective1 - Kpi1 - UnitA
KPI2 - UnitA
Perspective2 - Kpi1 - UnitA
KPI2 - UnitA

Thnx for your help.

- Stanley


"Brian Altmann" wrote:

Quote:
Maybe this Foodmart query might help:

select
{[Measures].[Unit Sales]} on columns,
hierarchize(generate ( filter([Product Name].members,
right(product.currentmember.name,10)="Light Beer"),
ascendants(product.currentmember))) on rows
from Sales

Instead of

right(product.currentmember.name,10)="Light Beer"

you could use something like:

[Your dimension].currentmember.name="UnitB"

HTH,
Brian
www.geocities.com/brianaltmann/olap.html

"Stanley" wrote:

Hi,

I'm posting again because i accidentally pressed the post button.

I have a dimension with the following levels:

Perspective1
KPI1
UnitA
UnitB
UnitC
KPI2
UnitA
UnitB
UnitC
Perspective2
KPI1
UnitA
UnitB
UnitC
KPI2
UnitA
UnitB
UnitC
Etc.....

In my SQL Report i want to create a parameter where i can select t he Unit.
The report should return all the levels concerning that specific Unit. So if
i select UnitB, i should get:

Perspective1
KPI1
UnitB
KPI2
UnitB
Perspective2
KPI1
UnitB
KPI2
UnitB

I know you can do something like:
[All Perspective].[KPI].members
to get all the Units.
But now i want only one unit with all the KPIs. Is this possible?

Probably you would say to rearrange my cube and dimensions, but i already
did(because of another 'problem') and came up with this version. So, if it's
not possible than i will go back to my previous design, because basically
this design works best for me .

Thnx,

Stanley

Reply With Quote
  #4  
Old   
Brian Altmann
 
Posts: n/a

Default RE: Select a deepest level with varibale sub levels (part2) - 12-16-2004 , 11:13 AM



I thought you wanted the whole hierarchy. A simpler query should be what you
want, such as:

select
{[Measures].[Unit Sales]} on columns,
filter([Product Name].members,
right(product.currentmember.name,10)="Light Beer")
on rows
from Sales

Regards,
Brian


"Stanley" wrote:

Quote:
Hi Brian,

This helped some. I did get the KPIs of a certain Unit, but the outcome of
the query gives me the whole hierarchy,like when i filter on UnitA:

Perspective1
Perspective1 - KPI1
Perspective1 - KPI1 - UnitA
Kpi2 - UnitA
Perspective2 - KPI1
Perspective2 - KPI1 - UnitA
KPI2 - UnitA

I would like to have the lowest level only:

Perspective1 - Kpi1 - UnitA
KPI2 - UnitA
Perspective2 - Kpi1 - UnitA
KPI2 - UnitA

Thnx for your help.

- Stanley


"Brian Altmann" wrote:

Maybe this Foodmart query might help:

select
{[Measures].[Unit Sales]} on columns,
hierarchize(generate ( filter([Product Name].members,
right(product.currentmember.name,10)="Light Beer"),
ascendants(product.currentmember))) on rows
from Sales

Instead of

right(product.currentmember.name,10)="Light Beer"

you could use something like:

[Your dimension].currentmember.name="UnitB"

HTH,
Brian
www.geocities.com/brianaltmann/olap.html

"Stanley" wrote:

Hi,

I'm posting again because i accidentally pressed the post button.

I have a dimension with the following levels:

Perspective1
KPI1
UnitA
UnitB
UnitC
KPI2
UnitA
UnitB
UnitC
Perspective2
KPI1
UnitA
UnitB
UnitC
KPI2
UnitA
UnitB
UnitC
Etc.....

In my SQL Report i want to create a parameter where i can select t he Unit.
The report should return all the levels concerning that specific Unit. So if
i select UnitB, i should get:

Perspective1
KPI1
UnitB
KPI2
UnitB
Perspective2
KPI1
UnitB
KPI2
UnitB

I know you can do something like:
[All Perspective].[KPI].members
to get all the Units.
But now i want only one unit with all the KPIs. Is this possible?

Probably you would say to rearrange my cube and dimensions, but i already
did(because of another 'problem') and came up with this version. So, if it's
not possible than i will go back to my previous design, because basically
this design works best for me .

Thnx,

Stanley

Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.