MDX : How to use filter on a dimension without showing it OR merge 2 attributes of the same dimension?

Hello everyone,
I'm kind of newbie with MDX language, I'm trying to get filtered measures from a cube with a specific layout.
Here is my exemple :
I want to get all the "order numbers" where the "invoice" cost is more than 300.  Each invoice is linked with an ID, one order number can have several invoices.
So what I do is a select request with 2 dimensions : "order num" and "id_invoice"
Here is the result : I get all the cost sorted by "order num" and I can easealy identify those who are above 300
order num
Id_invoice
cost
Total
Total2
15450307
10032013094498
1671
1737
ok
15450307
10032013099835
66
1737
KO
15450596
10032013094078
8524
8524
ok
15451214
10032013094119
228
4348
KO
15451214
10032013097069
978
4348
ok
15451214
10032013097071
3142
4348
ok
15542434
10032013101736
142
142
KO
15550064
10032013097016
1261
1261
ok
15550346
10032013097586
2252
2252
ok
15550353
10032013098446
2617
2617
ok
What i need : In "cost", I need to have the sum of each cost which are above 300 in one line (without showing the invoice id)
order num
cost
Total
Total2
15450307
1671
1737
ok
15450596
8524
8524
ok
15451214
4120
4348
ok
15550064
1261
1261
ok
15550346
2252
2252
ok
15550353
2617
2617
ok
How is it possible to use a filter on a dimension without showing it or merge 2 attributes of the same dimension ?
The problem is that if I show "id" column, the filter doesn't work properly : it compares 300 with the total cost of the whole order and does not compare with each invoice (which could be under 300 ! - see "KO" in Total2 column)
Here is the request I use to generate this result :
with
member [Measures].[Total]
as (
[TP].[ID INVOICE].[All],
[TP].[ORDER NUM].currentmember,
[Measures].[COST]
member [Measures].[Total2]
as (
IIF([Measures].[COST] >
300, "ok",
"KO")
select
{[Measures].[COST],[Measures].[Total],[Measures].[Total2]}
on
columns,           
Filter
             [TP].[ORDER NUM].[ORDER
NUM].members *
             [TP].[ID INVOICE].[ID
INVOICE].members
             ,[Measures].[COST]
> 0
on
rows
FROM [MYCUBE]
Thank you  for your help !
Kind regards,
Olivier.

Hi Olivier,
hereunder a similar query against the AW. For all order numbers, we sum all lines above 30 without diplaying the line numbers:
WITH
MEMBER [Measures].[lines above 30] AS
IIF(
[Measures].[Internet Sales Amount] > 30,
[Measures].[Internet Sales Amount],
null
MEMBER [Measures].[aggr lines above 30] AS
SUM(
exists(
[Internet Sales Order Details].[Sales Order Line].[Sales Order Line],
[Internet Sales Order Details].[Sales Order Number].currentmember
[Measures].[lines above 30]
SELECT
[Measures].[Internet Sales Amount],
[Measures].[aggr lines above 30]
} ON 0,
[Internet Sales Order Details].[Sales Order Number].[Sales Order Number] ON 1
FROM ( SELECT
[Product].[Category].[All Products] ON 0,
[Internet Sales Order Details].[Sales Order Number].&[SO51177]:
[Internet Sales Order Details].[Sales Order Number].&[SO51178]
} ON 1
FROM [Adventure Works] )
I reduced the cube with a subselect.
Philip,

Similar Messages

  • How can i sync my old ipod without knowing my old password and dont have the same email without loosing everything??

    How can I sync my old Ipod without loosing everything? I dont remember my old password and dont have the same email. I have many pics stored on there of many trips we took over the years and songs as well please help...

    What are you wanting to do exactly?  Are you trying to sync this older iPod with a new/different iTunes library from the one you originally set it up with?
    B-rock

  • How do I set upmy Imac to allow using both my computer speakers and a Bose SoundLink system as outputs at the same time.  I can use one or the other, but not both.

    how do I set up my Imac to allow using both my computer speakers and a Bose SoundLink system as outputs at the same time.  I can use one or the other, but not both.  From systems Preferences I must select one or the other.  I want both to work all the time.

    Hi,
    I would recommend you to use 0FI_AP_4 rather using both, particularly for many reasons -
    1. DS: 0FI_AP_4  replaces DataSource 0FI_AP_3 and still uses the same extraction structure. For more details refer to the OSS note 410797.
    2. You can run the 0FI_AP_4 independent of any other FI datasources like 0FI_AR_4 and 0FI_GL_4 or even 0FI_GL_14. For more details refer to the OSS note: 551044.
    3. Map the 0FI_AP_4 to DSO: 0FIAP_O03 (or create a Z one as per your requirement).
    4. Load the same to a InfoCube (0FIAP_C03).
    Hope this helps.
    Thanks.
    Nazeer

  • How to Use 'uid' for AD Users Without Domain Name For User Log in OAM

    How to Use 'uid' for synchronized Active Directory (AD) Users into Oracle Internet Directory (OID) Without Domain Name For User Logins in OIDDAS and OAM
    We successfully integrated OAM 11g with EBS R12.1.3 Now all the AD user id's stored in fnd_users table as [email protected]
    How can we remove @abc.com
    We are using OID 11g and OAM 11g
    Found the similar note for OID 10G: How to Use 'uid' for AD Users Without Domain Name For User Logins in OIDDAS and SSO [ID 580480.1]
    We are in OID 11g.
    Any help on this greatly appreciated.

    I couldn't find any reference that could be helpful -- Please log a SR and see if this is supported and if the steps are available.
    Thanks,
    Hussein

  • How do I keep my daughter and I's apps and contact info SEPERATE on the same itunes while sharing songs?

    How do I keep my daughter and I's apps and contact info SEPERATE on the same itunes while sharing songs?
    I need step by step directions on set up different profiles on itunes for 2 seperate iphones. I want to be able to share purchases if desired, but not have to have the same apps/songs on our phones. I could do with sharing songs.....apps not so much. Please Help!!
    Thank You

    This should help:
    How to use multiple iPods, iPads, or iPhones with one computer
    Regards.

  • I have files in my iTunes media folder that somehow are not in my library. How do I get iTunes to scan my media folder and add missing files to my library without making a copy of each file in the same location?

    I have files in my iTunes media folder that somehow are not in my library. How do I get iTunes to scan my media folder and add missing files to my library without making a copy of each file in the same location? If I use add file / folder to library, it scans the folder and then makes a copy of any file that is not in my library in the exact same location; I recal in older versions of iTunes being able to just drag my media folder into my library and it would update missing links.

    Only the songs that are connected to iTunes will be copied when you consolidate to a new folder.
    Splitting the media folder away from the usual location makes it harder to move iTunes in the future.
    Are you go move everything back once you've tidied up or are you going to leave it that way? Either way I'd recommend you create an iTunes folder at the new location, an iTunes Media folder inside that, and consolidate to this new iTunes Media folder. You should also use the option File > LIbrary > Organize Library > Rearrange files in the folder "<Media Folder"> if you have not already done so.
    tt2

  • I'm trying to record audio into my iPad2 using GarageBand and an iRig, but I can't monitor my tracks at the same time as recording, meaning if I lay down a drum track and attempt to record guitar, I can't hear the drums while recording. Thoughts?

    I'm trying to record audio into my iPad2 using GarageBand and an iRig, but I can't monitor my tracks at the same time as recording, meaning if I lay down a drum track and attempt to record guitar, I can't hear the drums while recording. Thoughts?

    Hi, I have this exact same problem. I haven't been using an iRig, just a cheap USB-jack cable. I managed to do this with the first cable I bought, but since it broke I've been unable to find a replacement that allows me to hear the drums while recording. DId you manage to get over this issue? If so I would really like to know how. Thanks and best wishes.

  • Measure using UseRelationship not working well when sliced with attributes from the same table

    Hi,
    I have Measure created using the 'UseRelationship' Function, which uses a different datekey to link to the DateDim than the one the table is directly related by. The measure works as expected except in one scenario.
    If I browse the measure using an attribute from the same fact table then the attribute is filtered using active relationship whereas the measure is filtered using the inactive relationship as shown below:
    FACT(2 rows)(Active Relationship to Date using DateKey1)
    SNo     DateKey1     DateKey2     Geo        Amt
    1         20100101     20120101    India      100
    2         20100101     20120101    US         200
    AmtMeasure:=CALCULATE(SUM([Amt]),USERELATIONSHIP(FACT[DateKey2],'Date'[DateKey]))
    If I browse the above measure in excel, with Year selected as 2012, I get 100+200=300. Now if I drag the Geo attribute against the measure I get 2 rows with 100 and 200.
    If I do the same in a power view report I don't get any results after dragging the Geo attribute, whereas I get the correct value of 300 without the geo attribute. I checked the DAX query which the power view generates and figured this is being caused because
    there are no rows in the table with DateKey1 having year 2012. I understand why this is happening this way in a DAX query and not in MDX, but shouldn't both behave in the same way and what is a work around.
    Thanks,
    Sachin Thomas

    Sac, is this still an issue?
    Thank you!
    Ed Price, Azure & Power BI Customer Program Manager (Blog,
    Small Basic,
    Wiki Ninjas,
    Wiki)
    Answer an interesting question?
    Create a wiki article about it!

  • HT5649 how can you add a previous playlist from a different apple Id  both belong to the same person

    how can you add a previous playlist form a different apple ID, both belong to the same person

    It's ok to share the same AppleID for iTunes.  Use Separate ID's for iCloud, iMessage, and Facetime. 

  • Hi, I have a macbook air os x 10.9.5 and I have problems with the app store. It doesn't open anyway. so, how can I install it again or update. I have problems with preview too, the same, doesn't open the application

    Hi, I have a macbook air os x 10.9.5 and I have problems with the app store. It doesn't open anyway. so, how can I install it again or update. I have problems with preview too, the same, doesn't open the application

    Reinstalling OS X Without Erasing the Drive
    Boot to the Recovery HD: Restart the computer and after the chime press and hold down the COMMAND and R keys until the menu screen appears. Alternatively, restart the computer and after the chime press and hold down the OPTION key until the boot manager screen appears. Select the Recovery HD and click on the downward pointing arrow button.
    Reinstalling OS X Without Erasing the Drive
    Repair the Hard Drive and Permissions: Upon startup select Disk Utility from the main menu. Repair the Hard Drive and Permissions as follows.
    When the recovery menu appears select Disk Utility and press the Continue button. After Disk Utility loads select the Macintosh HD entry from the the left side list.  Click on the First Aid tab, then click on the Repair Disk button. If Disk Utility reports any errors that have been fixed, then re-run Repair Disk until no errors are reported. If no errors are reported click on the Repair Permissions button. Wait until the operation completes, then quit Disk Utility and return to the main menu.
    Reinstall OS X: Select Reinstall OS X and click on the Continue button.
    Note: You will need an active Internet connection. I suggest using Ethernet if possible because it is three times faster than wireless.
    Alternatively, see:
    Reinstall OS X Without Erasing the Drive
    Choose the version you have installed now:
    OS X Yosemite- Reinstall OS X
    OS X Mavericks- Reinstall OS X
    OS X Mountain Lion- Reinstall OS X
    OS X Lion- Reinstall Mac OS X
         Note: You will need an active Internet connection. I suggest using Ethernet
                     if possible because it is three times faster than wireless.

  • HT2486 how do I copy an existing Group in Contacts to create a new group with the same contacts in it?

    How do I copy an existing group in Contacts to create a new group with the same contacts in it?

    Hi there,
    Unfortunately the use case you describe hasn't been implemented in Firefox. It's not possible to move a tab group out to its own window at this point. Generally the tab groups feature hasn't been worked on much recently, not sure why.
    As to TabMixPlus, that's a third-party add-on which Mozilla doesn't directly support. You can find support links from the add-on page: https://addons.mozilla.org/en-us/firefox/addon/tab-mix-plus/
    Hope this helps.
    Cheers,
    David

  • How do i send a group email without showing recipient names?

    hi
    i would like to ask how do i send a group email without showing recipient names - without using bcc!
    i have seen that peple send group emails and only the only info that appers is the: from and to emails are the same as the sender email.
    how do i do that?
    isnt there any app for Gmail to do that?
    i am using gmail
    thank you

    If you address the email to yourself and then put all your recipients in the bcc it appears to each recipient as if they got your email. In other words they will not see anyone else's name or even their own name - just yours.

  • HT4878 How do i share my pictures, music and videos from one user to another on the same computer?

    How do i share my pictures, music and videos from one user to another on the same computer?

    lots of ways... you could use a thumb drive, you could drag files to the users public folder drop box, you could send it through email, you could use the internet servic called drop box (not to be confused with Apple's user public foldelr drop box).

  • How do i backup my iphone 3 started on one itunes account and restore to the same phone with a different itunes account without losing all my information?

    how do i backup my iphone 3 started on one itunes account and restore to the same phone with a different itunes account without losing all my information?

    Please search the forums. This has been covered here extensively.

  • How do I merge multiple subscriptions to the same podcast?

    In iTunes I have multiple subscriptions to the same identical podcast (same podcast name and same url) ... some of the subscriptions have duplicated entries and some have unique entries ... (how this happened I have no idea, but that is beside the point) ... my question is how do I merge these multiple subscriptions into a single podcast subscription? I have tried cut & paste in the hope that I could then delete (unsubscribe) to all of the redundant/repeated subscriptions, but that does not work ... in explorer I have found that ALL my podcast files from ALL my podcast subscriptions are found in a single folder .. so all the entries from my multiple subscriptions are there as well ... this smoked my hope that each podcast subscription would have it's own folder or sub-folder ... so I'm stuck ... does anyone know how I can merge multiple subscriptions to the same podcast into a single podcast subscription (without my losing the uniques scattered throuhout the mutiple subscriptions) ... ???

    I would love to be able to do exactly what you are suggesting .. the problem is, if I delete the duplicate subscriptions, I lose the unique files unique to the duplicate subscription I delete ... the problem is that I can't find a way to save/move the uniques (in advance of deleting the duplicate subscription) into a single subscription ... is there a way to do this ??? Does anyone know how to do this ??? Please help !!!

Maybe you are looking for

  • TS3230 Safari quit unexpectedly while using the librooksbas.dylib plug-in what do I do?

    "Safari quit unexpectedly while using the librooksbas.dylib plug-in" How do I fix this problem? I need to get on line. So if someone has a fix for this problem it sure would help.

  • Movies disappear from iPod when syncing with iTunes

    I have an odd problem. I have some movies that I converted for iPod using iSquint. They play fine in iTunes and will play fine on iPod when dragged to my iPod manually. However, as soon as I change to automatic syncing the movies disappear upon the f

  • Command-line paste problem

    Hi! I have a following problem: When I try to paste long input to my command-line app, only few first lines are pasted. I see, that I Can copy that to apps like TextWrangler, TextEdit. What Can I do? Regards.

  • Positioning of an image in a template

    I have an image that I have manually placed in the bottom right corner of the main content div on every page of the site. This image is not part of the template, I inserted and floated it on every page after I created the page from the template. What

  • Re : Highlight Search rsults in RoboHelp 7 (webHelp)

    Hello there, How are you ? I am a newbie at using Robohelp. Our company just purchsed Robohelp licenses and I was trying to pickup this tool. I could create the html help file with TOC and Index. Search works great but what's baffling me is that the