![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
I have couple of dimensions placed in the page section of the pivot report and they are quite large like customer, products, etc I want to exclude a few customers and products but I cannot figure out how to exclude certain customers or products in the pivot report I can only include. But include does not help since apart from the few customers I want to exclude I need to include a large of remaining customers. Thanks Karen |
#3
| |||
| |||
|
|
I have couple of dimensions placed in the page section of the pivot report and they are quite large like customer, products, etc I want to exclude a few customers and products but I cannot figure out how to exclude certain customers or products in the pivot report I can only include. But include does not help since apart from the few customers I want to exclude I need to include a large of remaining customers. Thanks Karen |
#4
| |||
| |||
|
|
Actually, there is a way to do it natively in Analysis Services. The EXCEPT function in MDX can do what you're describing. From books online, its syntax: Except(«Set1», «Set2»[, ALL]) Duplicates are eliminated from both sets prior to finding the difference. The optional ALL flag retains duplicates. Matching duplicates in «Set1» are eliminated and nonmatching duplicates are retained. What you'd want to do is put what you want to exclude in Set2, while being sure it's also in Set1, and leave the ALL agrument out. Let's take Foodmart as an example. Say you wanted to exclude CA from the three states that have data in the customer dimension: select measures.members on columns, except({[Customers].[country].[USA].children}, {[Customers].[All Customers].[USA].[CA]}) on rows from sales See how Califronia is now excluded from the rows? If you have the ability to control what gets passed into an MDX statement with your front end, and what functions can be used, the EXCEPT MDX function is the way to go. Good luck. "karenmiddleol (AT) yahoo (DOT) com" wrote: I have couple of dimensions placed in the page section of the pivot report and they are quite large like customer, products, etc I want to exclude a few customers and products but I cannot figure out how to exclude certain customers or products in the pivot report I can only include. But include does not help since apart from the few customers I want to exclude I need to include a large of remaining customers. Thanks Karen |
#5
| |||
| |||
|
|
SQL McOLAP wrote: Actually, there is a way to do it natively in Analysis Services. The EXCEPT function in MDX can do what you're describing. From books online, its syntax: Except(«Set1», «Set2»[, ALL]) Duplicates are eliminated from both sets prior to finding the difference. The optional ALL flag retains duplicates. Matching duplicates in «Set1» are eliminated and nonmatching duplicates are retained. What you'd want to do is put what you want to exclude in Set2, while being sure it's also in Set1, and leave the ALL agrument out. Let's take Foodmart as an example. Say you wanted to exclude CA from the three states that have data in the customer dimension: select measures.members on columns, except({[Customers].[country].[USA].children}, {[Customers].[All Customers].[USA].[CA]}) on rows from sales See how Califronia is now excluded from the rows? If you have the ability to control what gets passed into an MDX statement with your front end, and what functions can be used, the EXCEPT MDX function is the way to go. Good luck. "karenmiddleol (AT) yahoo (DOT) com" wrote: I have couple of dimensions placed in the page section of the pivot report and they are quite large like customer, products, etc I want to exclude a few customers and products but I cannot figure out how to exclude certain customers or products in the pivot report I can only include. But include does not help since apart from the few customers I want to exclude I need to include a large of remaining customers. Thanks Karen Hi SQL McOLAP & Michael Many thanks for the pains in explaining the Except clause. But my problem unlike : select measures.members on columns, except({[Customers].[country].Â*[USA].children}, {[Customers].[All Customers].[USA].[CA]}) on rows from sales I do not want to display Customers on rows I want Say Measures on columns and products on rows I want to include many customers and exclude a few I cannot do this in the where clause when I use the Except in the where clause it gives errors saying cannot convert a set to tuple Thanks Karen |
#6
| |||
| |||
|
|
Actually, there is a way to do it natively in Analysis Services. The EXCEPT function in MDX can do what you're describing. From books online, its syntax: Except(«Set1», «Set2»[, ALL]) Duplicates are eliminated from both sets prior to finding the difference. The optional ALL flag retains duplicates. Matching duplicates in «Set1» are eliminated and nonmatching duplicates are retained. What you'd want to do is put what you want to exclude in Set2, while being sure it's also in Set1, and leave the ALL agrument out. Let's take Foodmart as an example. Say you wanted to exclude CA from the three states that have data in the customer dimension: select measures.members on columns, except({[Customers].[country].[USA].children}, {[Customers].[All Customers].[USA].[CA]}) on rows from sales See how Califronia is now excluded from the rows? If you have the ability to control what gets passed into an MDX statement with your front end, and what functions can be used, the EXCEPT MDX function is the way to go. Good luck. "karenmiddleol (AT) yahoo (DOT) com" wrote: I have couple of dimensions placed in the page section of the pivot report and they are quite large like customer, products, etc I want to exclude a few customers and products but I cannot figure out how to exclude certain customers or products in the pivot report I can only include. But include does not help since apart from the few customers I want to exclude I need to include a large of remaining customers. Thanks Karen |
#7
| |||
| |||
|
|
However - if you want to do drill through at some point then that won't be possible with this aggregating ? But if that isn't necessary then it could the way to go.. karenmiddleol (AT) yahoo (DOT) com> wrote in message news:1116189556.052736.28460 (AT) g47g2000cwa (DOT) googlegroups.com... SQL McOLAP wrote: Actually, there is a way to do it natively in Analysis Services. The EXCEPT function in MDX can do what you're describing. From books online, its syntax: Except(«Set1», «Set2»[, ALL]) Duplicates are eliminated from both sets prior to finding the difference. The optional ALL flag retains duplicates. Matching duplicates in «Set1» are eliminated and nonmatching duplicates are retained. What you'd want to do is put what you want to exclude in Set2, while being sure it's also in Set1, and leave the ALL agrument out. Let's take Foodmart as an example. Say you wanted to exclude CA from the three states that have data in the customer dimension: select measures.members on columns, except({[Customers].[country].[USA].children}, {[Customers].[All Customers].[USA].[CA]}) on rows from sales See how Califronia is now excluded from the rows? If you have the ability to control what gets passed into an MDX statement with your front end, and what functions can be used, the EXCEPT MDX function is the way to go. Good luck. "karenmiddleol (AT) yahoo (DOT) com" wrote: I have couple of dimensions placed in the page section of the pivot report and they are quite large like customer, products, etc I want to exclude a few customers and products but I cannot figure out how to exclude certain customers or products in the pivot report I can only include. But include does not help since apart from the few customers I want to exclude I need to include a large of remaining customers. Thanks Karen Hi SQL McOLAP & Michael Many thanks for the pains in explaining the Except clause. But my problem unlike : select measures.members on columns, except({[Customers].[country].Â*[USA].children}, {[Customers].[All Customers].[USA].[CA]}) on rows from sales I do not want to display Customers on rows I want Say Measures on columns and products on rows I want to include many customers and exclude a few I cannot do this in the where clause when I use the Except in the where clause it gives errors saying cannot convert a set to tuple Thanks Karen |
#8
| |||
| |||
|
#9
| |||
| |||
|
|
SQL McOLAP & Michael Many thanks I read a few books on MDX could not figure the Except clause MDX as been so difficult when compared to SQL syntax wide. I was beating my head to the wall with this problem. Many thanks for your help I will try this solution if I have any issues I will repost the question. I never thought excluding values in dimensions was this difficult. Also, now we are excluding values only from the customers dimension how about if I had a condition I also wanted to exclude [Gender].[All Gender].[M] as well apart from the above customers from the sales reported how do I put a AND condition to include this additional condition in the where clause please advice. Thanks again Karen |
#10
| |||
| |||
|
![]() |
| Thread Tools | |
| Display Modes | |
| |