Using mdx query from Java Apache
Please suggest/guide me how to use MDX query to pull data from cube from Apache JAVA??
BI GUY
Hi BIGUY,
Multidimensional Expressions (MDX) is the query language that you use to work with and retrieve multidimensional data in Microsoft Analysis Services. MDX is based on the XML for Analysis (XMLA) specification, with specific extensions for SQL Server Analysis
Services.
According to your description, it's hard to give your the exact MDX query to pull the data which you want from the cube since there are no any detail information about the cube. Here are some basic knowledge for your reference.
Querying Multidimensional Data with MDX
MDX Sample
Regards,
Charlie Liao
TechNet Community Support
Similar Messages
-
Except function with parent child hierarchy using mdx query
HI,
I need to remove some items using mdx query in parent child hierarchy.
I tried with below query,it is not removeing ,could you please help me.
SELECT
{[Measures].[Amount]} ON
COLUMNS
NonEmpty([Account].[Accounts].[Account Level 01],[Measures].[Amount])
ON ROWS
FROM (SELECT
-Descendants({[Account].[Accounts].&[47]},,Leaves)
} ON COLUMNS
FROM [Adventure Works])
induHi Indu,
Why do you remove some itmes using
Descendants function? Generally, we use FILTER function to achieve the requirement.
WITH SET [CustomAccounts] AS
FILTER ([Account].[Accounts].[Account Level 01].Members , [Account].[Accounts].CurrentMember.Name<>'Net Income')
SELECT {[Measures].[Internet Sales Amount]} ON 0
[CustomAccounts] ON 1
FROM [Adventure Works]
WITH SET [CustomAccounts] AS
FILTER ([Account].[Accounts].[Account Level 01].Members , [Account].[Accounts].CurrentMember.Name='Net Income')
SET [RemainingAccount] AS
[Account].[Accounts].[Account Level 01]- [CustomAccounts]
SELECT {[Measures].[Reseller Sales Amount]} ON 0
[RemainingAccount] ON 1
FROM [Adventure Works]
Results.
References.
http://www.databasejournal.com/features/mssql/article.php/3306101/MDX-Essentials-Basic-Set-Functions-The-Filter-Function.htm
http://social.msdn.microsoft.com/Forums/sqlserver/en-US/c0149678-97f2-4066-903f-7f9e9ff09b56/filtering-out-dimension-members-with-mdx?forum=sqlanalysisservices
Regards,
Charlie Liao
If you have any feedback on our support,
please click here.
Charlie Liao
TechNet Community Support -
IIf condition between dates using mdx query
Hi,
how to check IIF condition between dates using mdx query.
I able to check single year,plese check below mdx query.I need to check members between years.
my requirement is member is belongs to between years(2007 to 2010),display "yes" else "NO";
Could you please give me exact mdx query.
From,to-2007,2010,if member belongs to 2007to 2010 then disply "yes"else "no".
how to pass two members in IIf condition.
WITH
MEMBER Measures.[test]
AS Iif([Date].[Calendar Year].currentmember
is [Date].[Calendar Year].&[2007],"no","yes")
SELECT {Measures.[test]}
on 0
,[Product].[Subcategory].[Subcategory].MEMBERS * [Date].[Calendar Year].[Calendar Year]
ON 1
FROM [Adventure Works]
induHi Sriindu,
consider the following:
WITH
MEMBER measures.[test] AS
IIF
Exists
[Date].[Calendar Year].CurrentMember
[Date].[Calendar Year].&[2007] : [Date].[Calendar Year].&[20010]
).Item(0)
IS
[Date].[Calendar Year].CurrentMember
,"yes"
,"no"
SELECT
{measures.[test]} ON 0
[Product].[Subcategory].[Subcategory].MEMBERS
[Date].[Calendar Year].[Calendar Year] ON 1
FROM [Adventure Works];
Philip, -
How to use sql query in java ?
i don't know how to use sql query in java code.
who can give me some advice?
thankshttp://java.sun.com/developer/onlineTraining/Database/JDBC20Intro/
-
Hi
Can I call a BEx Query from Java . If yes, in what format data will be returned? We just need data, we want to structure it in Java for display in a Flex UI.
Please note that I have very limited knowledge of both Java and BI.
Thanks in advance for your help.
Best Regards
SaurabhHi,
Yes you can. It will be contained in a web template.
Please read through the link below and the related links contained within.
http://help.sap.com/saphelp_nw70ehp1/helpdata/en/0d/af12403dbedd5fe10000000a155106/frameset.htm
Thanks,
Michael
Edited by: Michael Devine on May 25, 2010 3:40 PM -
Using word/excel from java (client or weblogic server)
Hi everybody,
i want to use excel / word functionality from java in two different variants:
-> serverside
-> clientside
I tried the weblogic.comc and i got serveral classes but in the remote-package i got only a utitlity-class.
My knowlege about COM is rather bad.
Does anybody did this bevor and
-> can say me, if it is correct, that i only got a utility-class (so how will i use it from the client ?!)
-> has a example for using Excel / Word from Java in bea weblogic
-> has a example for using Excel / Word directly in a client (not via rmi)
Thanks
Ciao
SvenSven, This is a really bad idea. Why don't you tell me
what your trying to do and I wil surely give you a better alternative
JRadecki
"Sven Roesner" <[email protected]> wrote:
>
Hi everybody,
i want to use excel / word functionality from java in two different variants:
-> serverside
-> clientside
I tried the weblogic.comc and i got serveral classes but in the remote-package i got only a utitlity-class.
My knowlege about COM is rather bad.
Does anybody did this bevor and
-> can say me, if it is correct, that i only got a utility-class (so how will i use it from the client ?!)
-> has a example for using Excel / Word from Java in bea weblogic
-> has a example for using Excel / Word directly in a client (not via rmi)
Thanks
Ciao
Sven -
Hi all!, someone knows about an API that let me use a scanner from Java?
without programing JNI code.
thks in advance!.The Java Twain package from http://www.gnome.sk does exactly what you need. You do not have to bother about jni, you can get an image from the scanner directly from your java application.
Erika -
Using Inbound IDOC from Java system creation of Outbound delivery
Dear Experts,
The scenario we are having is really very interesting. Hopefully its a good learning for me and also for others also.
The scenario is,
After sales order creation the details will be sent to one Non SAP system (Java) for performing some tasks related to forwarding agent decision, shipping date and etc. Once the details are finalized in that Java system then, the details needs to be transferred to SAP as "Inbound IDOC" process. For this proposed to use the SAP Jco middle ware.
Once the details transfered from Java system to SAP then, the outbound IDOC needs to get generated automatically. Assuming the stock for that sales order line item is available. Also one more complexity is, our client is using custom transaction (ZVl10C) for delivery creation.
Now Query is,
1. Which IDOC, message type and Functional module needs to be used for creating the delivery automatically..??
2. As per assumption, stock of that sales order line item should be available. Due to some business reason the stock was removed during inbound IDOC transfer then, what will happen to the IDOC..?. How to avoid this situation..??
3. As we told we are re going to use SAP Jco b/w SAP & Java system. In this case, how the data will get transfered from Java system to SAP..?
Thanks in advance for the replies I am going to get
Regards,
VELThanks for the feedback. This question is resolved
-
Date parameters using MDX query
Hello experts,
Not sure if this question falls under SSAS or SSRS but I'm writing it here for now and hopefully get the answer.
I'm using SSAS cube to develop a report using SSRS and this is the first time I'm doing it. I want to filter records based on date range and did some research online. My report contains two datasets:
1. dsMain dataset -> it contains all the field which I want to use in the report and added a parameter thru query designed with following settings:
Dimension : Dates
Hierachary : Date
Operator : Range (Inclusive)
Parameters : checked
it created two parameters called FromDatesDate and toDatesDate
2. I created another dataset called dsDate and wrote a custom query (found at following link) and changed FromDatesDate and ToDatesDate using this date dataset
https://jsimonbi.wordpress.com/2011/03/22/using-a-date-parameter-in-ssrs-with-mdx/
Query for dsDate
WITH
MEMBER DateValue
AS
[Dates].[Date].CurrentMember.UniqueName
MEMBER DateLabel
AS
[Dates].[Date].CurrentMember.Name
SELECT
[Measures].[DateValue],
[Measures].[DateLabel]
} ON 0,
[Dates].[Date].[Date]
} ON 1
FROM [myCube]
Here is the value returned by dsDate dataset (above query)
DateValue DateLabel
06/04/1980 [Dates].[Date].&[29375]
06/04/1980
06/05/1980 [Dates].[Date].&[29376]
06/05/1980
06/06/1980 [Dates].[Date].&[29377]
06/06/1980
06/07/1980 [Dates].[Date].&[29378]
06/07/1980
06/08/1980 [Dates].[Date].&[29379]
06/08/1980
06/09/1980 [Dates].[Date].&[29380]
06/09/1980
06/10/1980 [Dates].[Date].&[29381]
06/10/1980
06/11/1980 [Dates].[Date].&[29382]
06/11/1980
06/12/1980 [Dates].[Date].&[29383]
06/12/1980
06/13/1980 [Dates].[Date].&[29384]
06/13/1980
Here is what I changed in FromDatesDate and ToDatesDate parmeter:
Under Available Values tab:
Dataset : dsDate
Value Field : DateValue
Label Field : DateLabel
Here are my questions:
1. I want to use date/time parameter so that user doesn't have to scroll thru whole date dimension.
2. I changed the FromDatesDate and ToDatesDate to date/time parameter, removed the values from Available values tab and made the following changes on Parmaeters expression under dsMain dataset
=”[Dates].[Date].&[” + Format(CDate(Parameters!FromDatesDate.Value),”MM/dd/yyyy”)
+ “T00:00:00]”
=”[Dates].[Date].&[” + Format(CDate(Parameters!ToDatesDate.Value),”MM/dd/yyyy”)
+ “T00:00:00]”
Now when I run the report I get following error:
Query (1, 55) The restrictions imposed by the CONSTRAINED flag in the STRTOMEMBER function are violated.
I think the reason is by changing parameter to date/time, now I cannot get "DateValue" which is required for the query.
1. What is the best way to work with date parameters?
Hope it is all clear and look forward to hear from experts.
Thanks,
P
mark it as answer if it answered your question :)Hi Parry2k,
In Analysis Services, a member can be referenced by either its member name or by its member key. The member key is used by the dimension to specifically identify a given member. The ampersand (&) character is used in MDX to differentiate
a member key from a member name. In this scenario, the datetime is member name, not the member key. So you should not add "&".
Reference:
Member Names and Keys
Simon Hou
TechNet Community Support -
SSRS report using mdx query to display sales of product by yearwise
There is a requirement to create SSRS report as
Product +Calender2011 -Calender 2012 +Calender 2013
+ Calender 2014
Jan12 Feb12 Mar12...
Product 1 50 100 200 ..
Product 2 150 900 200 ..
Product 3 250 180 900 ..
Product 4 450 100 200 ..
Product 5 50 100 200 ..
Product 6 50 100 200 ..
When I click on Calender2011 corresponding all months of 2011 has to appear and likewise for Calender2012, CalenderN
The MDX query I have like as follows-
Select Non Empty{
[Measures].[Product1],
[Measures].[Product2],
[Measures].[Product3],
[Measures].[Product4],
[Measures].[Product5],
[Measures].[Product6],
[Measures].[Product7],
[Measures].[Product8],
[Measures].[Product9],
[Measures].[Product10],
[Measures].[Product11],
} ON Rows ,
Non Empty { ([Dim Calendar H].[Year Name].[Year Name] ) *([Dim Calendar H].[Month name].[Month name])
ON COLUMNS
FROM ( SELECT ( { [Dim Calendar H].[Year Name].&[Calendar 2014],
[Dim Calendar H].[Year Name].&[Calendar 2013],
[Dim Calendar H].[Year Name].&[Calendar 2012],
[Dim Calendar H].[Year Name].&[Calendar 2011] } )
ON COLUMNS
FROM [Cube])
Please help me.
Advance thanks...Hi Afans,
According to your description, you want to create a drill-down report using SQL Server Analysis Services database, right?
In this case, you need add the Year and Month fields to the column group, and set the Month column can be toogled by Year column group. I have teste it on my local environment, here is the sample query for your reference.
select [Measures].[Internet Sales Amount] on 0,
[Product].[Category].members*[Date].[Calendar].[Calendar Year].members*[Date].[Month of Year].members on 1
from
[Adventure Works]
Reference
http://popbi.wordpress.com/2012/03/02/ssrs-how-to-add-a-column-group-to-an-existing-table/
http://msdn.microsoft.com/en-IN/library/dd207042.aspx
Regards,
Charlie Liao
TechNet Community Support -
I have a MDX query that I want to use in the RPD as "Table Type" =Select
I did create a new object as "Physical Dimension" and gave the below script as Essbase 11 specific SQL, but this does not work and an getting the generic error "[nQSError: 15002] Missing navigation space for subject area test. (HY000)". Any Idea as to how to use the MDX in RPD?
MDX Script:
with set classes as '{[Class_Data],[Inventory_Class_Data]}'
set ledgers as '{[Actuals_Ledger],[Finance_Ledger],[Reclass_Ledger],[Allocation_Ledger],[Blending_Ledger],[HCSADJ_Ledger]}'
set bu as '{[UTHCS],[UTMBG],[CONSL]}'
set account as 'Except ({filter ([Accounts].Levels(0).members, IsAncestor([SRECNA],[Accounts].CurrentMember)),
filter ([Accounts].Levels(0).members, IsAncestor([MISC_AUDIT],[Accounts].CurrentMember)),
filter ([Accounts].Levels(0).members, IsAncestor([SNA],[Accounts].CurrentMember))},{[Change in Net Assets and Restatements]})'
set funds as '{filter ([Fund].Levels(0).members,IsAncestor([All_Funds],[Fund].CurrentMember)),
filter ([Fund].Levels(0).members,IsAncestor([Do Not Use Funds],[Fund].CurrentMember))}'
select {[Act]} on columns,
Non Empty (CrossJoin(CrossJoin(
CrossJoin(account,funds),
CrossJoin(ledgers,bu)
),classes)
) on rows
from [finrpt15.work]
where (FY15,YTD_Apr,UTMB_INSTITUTION);
Thanks,
RaviHi BIGUY,
Multidimensional Expressions (MDX) is the query language that you use to work with and retrieve multidimensional data in Microsoft Analysis Services. MDX is based on the XML for Analysis (XMLA) specification, with specific extensions for SQL Server Analysis
Services.
According to your description, it's hard to give your the exact MDX query to pull the data which you want from the cube since there are no any detail information about the cube. Here are some basic knowledge for your reference.
Querying Multidimensional Data with MDX
MDX Sample
Regards,
Charlie Liao
TechNet Community Support -
Using ExecutorService class from java.util.concurrent package
Dear java programmers,
I have a question regarding the ExecutorService class from java.util.concurrent package.
I want to parse hundreds of files and for this purpose I'm implementing a thread pool. The way I use the ExecutorService class is summarized below:
ExecutorService executor = Executors.newFixedThreadPool(10);
for (int i = 0; i < 1000; i++){
System.out.println("Parsing file No "+i);
executor.submit(new Dock(i));
executor.shutdown();
try {
executor.awaitTermination(30, TimeUnit.SECONDS);
} catch (InterruptedException ex) {
ex.printStackTrace();
executor.shutdownNow();However, the code snippet above creates all the 1000 threads (Dock objects) at once and loads them to the executor, and thus I'm worrying about memory leak. I haven't tested it on 1000 files yet but just on 50 small ones, and even if the program prints out "Parsing file No "+i 50 times at once, it executes normally the threads in the background.
I guess the write way would be to keep the number of active/idle threads in the executor constant (lets say 20 if the thread pool's size is 10) and submit a new one whenever a thread has been finished or terminated. But for this to happen the program should be notified someway whenever a thread is done. Can anybody help me do that?
thanks in advance,
TomOk I found a feasible solution myself although I'm not sure if this is the optimum.
Here's what I did:
ExecutorService executor = Executors.newFixedThreadPool(10);
Future<String> future0, future1, future2, future3, future4, future5, future6, future7, future8, future9;
Future[] futureArray = {future0 = null, future1 = null, future2 = null, future3 = null, future4 = null, future5 = null,
future6 = null, future7 = null, future8 = null, future9 = null};
for (int i = 0; i < 10; i++){
futureArray[i] = executor.submit(new Dock(i));
}I created the ExecutorService object which encapsulates the thread pool and then created 10 Future objects (java.util.concurrent.Future) and added them into an Array.
For java.util.concurrent.Future and Callable Interface usage refer to:
[http://www.swingwiki.org/best:use_worker_thread_for_long_operations]
[http://www.particle.kth.se/~lindsey/JavaCourse/Book/Part1/Java/Chapter10/concurrencyTools.html]
I used a Future[] Array to make the code neater. So after that I submitted -and in this way filled up- the first 10 threads to the thread pool.
int i = 9;
while (i < 1000){
for (int j = 0; j < 10; j++){
if (futureArray[j].isDone() && i < 999){
try{
i++;
futureArray[j] = executor.submit(new Dock(i));
} catch (ExecutionException ex) {
ex.printStackTrace();
} catch (InterruptedException ex) {
ex.printStackTrace();
try {
Thread.sleep(100); // wait a while
} catch(InterruptedException iex) { /* ignore */ }
executor.shutdown();
try {
executor.awaitTermination(60, TimeUnit.SECONDS);
} catch (InterruptedException ex) {
ex.printStackTrace();
executor.shutdownNow();
}Each of the future[0-9] objects represents a thread in the thread pool. So essentially I'm check which of these 10 threads has been finished (using the java.util.concurrent.Future.isDone() method) and if yes I replenish that empty future[0-9] object with a new one. -
Call a C++ services using an uuid from java
I need to call a C++ services which is using the UUID for RPC. The interface is having the UUID. The previous client program is also in C++, they have used RpcBindingFromStringBinding(UUID value, .,.,.) to call the interface. Right now I need to call this service from Java using the UUID. Can anyone help me in it.
Passing the UUID should be the easy part, the tricky bit is performing an RPC from Java to C++. How are you doing that? Once you sort that out, passing arguments should be straight forward.
Note: Java's RMI only works between a client server running RMI. To connect to C++ server, you need to use a Java client library which is compatible with your C++ server.
If you still don't know how to perform the RPC call, I suggest you contact the people supporting the C++ program as they should know how RPC calls are made currently. If they don't know, it is highly unlikely we can guess a solution unless you are willing to change the C++ server to use a known RPC mechanism. -
To Open a Brio Query from Java
Hi,
I am using Hyperian Intellegence Explorer to get a information from the Data Base.
I want to do it automatic,because this we are doing this as a BAU.
I want to reduce my work load ,so thatpln to write a Code.
Please help me how to Open an existing BrioQuery from Java.corlettk wrote:
http://geocities.com/khory_scythe/Praxeum/jedicode.html
Yeah that fits... except I swear a lot. Is that allowed?
Jedi use their powers to defend and protect, never to attack others.Can we throw an exception for this one?
edit: actually i disagree with the whole jedi code, its wrong, wheres the fun...
Mel -
Error using DOS Command from Java
Hi,
I am using the following code to execute the DOS command to delete a file from Java.
cmd = "del " + fileName;
Runtime run = Runtime.getRuntime();
Process proc = run.exec(cmd);
Getting the following exception during runt time.
Exception = java.io.IOException: CreateProcess: del D:\LAWDOCS\P50074\12\3\36857.3 error=2 --
Can some body throw light on this?.
Thanks,
Jeyaraman R"del" is not an actual executable file, but instead a command in the command interpreter. So you can't just execute del like that, you have to run the command interpreter and tell it to execute the del command.
If you are on windows NT, 2000 or XP, replace your command with "cmd /C del " + filename.
If you are on Windows 95, 98 or ME, use "command /C del " + filename. (I am not quite sure if the switch for this is called /C on old windows version.)
(But why not use File.delete()?)
Maybe you are looking for
-
Help needed in Freight / Landed Cost
Hi, (1) Needed help in finalising the process of freight. In many cases (mostly interstate) the customer arranges for the transporter to bring the goods to the factory as the original vendor does not provide the facility of transportation. Now the cu
-
MDS Error: unable to create user DBs in /var/folders/...
What does this error mean? I have tons of them in my console. I have also repaired my permissions with Disk Utility, which found nothing in /var. Oct 21 15:29:02 macpro trustevaluationagent[25914]: MDS Error: unable to create user DBs in /var/folders
-
Loading larger image when dropped
Hey. I am working on this image scroller, where thumbnails of images are displayed. I get each image by function urlLoaded(event:Event):void { urlLoader.removeEventListener(Event.COMPLETE,urlLoaded); xml=XML(event.target.data); xmlLi
-
Can't uninstall Itunes / QuickTime
Hi there, I upgraded QickTime to v7 and used Mozilla Firefox to find the latest update. It pointed me to a combined QuickTime / Itunes and as I couldn't find a standalone Quicktime Product (have now found), I downloaded and installed. QT didn't run t
-
i have a windows vista and ipod touch 2nd gen. i have done this many times and still comes up the same. also now it wont install AMDS anymore.