Need an MDX query for Date range
Hi there,
My requirement is to filter sales from 1st of month to until holiday of the month. I am able to use to ":" range function for filtering, but I am not able to filter on holiday date. Becuase both filter and exists are giving set results, I need
member expression to use range function. Please let me know ASAP.
Thanks,
ATRSAMS
Hi ATRSAMS ,
You can get the first member of the month with the OpeningPeriod function, and item(#) to have a specific member from a set .
So if you want first member from your set : filter(.....).ITEM(0)
Regards, David .
Similar Messages
-
Query for date range? JE
Hi,
I have seem some posts on the JE forum regarding quering for date range, but it is mostly using DPL.
Is there any way to do that using the JE API
Thanks,
MohammadHi Mohammad,
A date range query can be performed as a key range query. There's nothing special about dates except that you'll want to use a key binding that gives a meaningful sort order. If you're representing your dates in milliseconds, then a LongBinding (in com.sleepycat.bind.tuple) will work well. In general, use tuple bindings for keys, because they provide a meaningful sort order.
To perform a range query, this FAQ has some hints:
http://www.oracle.com/technology/products/berkeley-db/faq/je_faq.html#28
On range searches in general, they can be done with Cursor.getSearchKeyRange or with the SortedSet.subSet and SortedMap.subMap methods, depending on whether you are using the base API or the Collections API. It is up to you which to use.
If you use Cursor.getSearchKeyRange you'll need to call getNext to iterate through the results. You'll have to watch for the end range yourself by checking the key returned by getNext. This API does not have a way to enforce range end values automatically.
If you use the Collections API you can call subMap or subSet and get an Iterator on the resulting collection. That iterator will enforce both the beginning and the end of the range automatically.
Does this answer your question?
--mark -
Query for date range? DPL
Sorry if this has been answered before, but I couldn't find the answer. I'm new to the DPL and was trying to find out how to query for objects that fall within a "date range". If I have an object that has a field "effective date", I would like to query for a list of objects that fall between a date range. Can I do this with DPL?
thanks,
JohnHi,
Yes, the DPL can be used to iterate over the entities where a given date field D falls with a specified date range. To do this, you define D as a @SecondaryKey, create a SecondaryIndex for it, and get a cursor for the specified range using one of the SecondaryIndex.entities() methods. Be sure to close the cursor.
See the Key Ranges section in this class description:
http://www.oracle.com/technology/documentation/berkeley-db/je/java/com/sleepycat/persist/EntityCursor.html
Dates are treated as long values, so a range of Date keys is no different that a range of long keys. Date and long are both "simple types" according to the DPL definition.
--mark -
Querying on date range issue?
Hi,
I'm looking for a solution for this issue,
In the DB Table there is a column of type TIMESTAMP. so when i query for date range using BETWEEN keyword it returns data inserted on next day at 12.00.00 AM
example :
Table A
ColumnA_
data1
data2
data3
ColumnTime_
08/03/2010 11.55.00 AM
08/04/2010 12.00.00 AM
08/04/2010 12.00.01 AM
here when I query using between (08/03/2010 and 08/04/2010) keyword on Column_Time then ,
Ouput
data1
data2
but I'm just looking for data1 in the output, any ideas?Between is inclusive of both boundaries:
column between condition1 and condition2Translates into
condition1 >= column
and
condition2 <= columnSo tell the code what you want ... in your case
condition1 >= column
and
condition2 < columnI'm not sure if you expect the >= or not...adjust as needed. -
Query to find first and last call made by selected number for date range
Hi,
query to find first and last call made by selected number for date range
according to filter:
mobile_no : 989.....
call_date_from : 25-april-2013
call_date_to : 26-april-2013
Please helpHi,
It sounds like you want a Top-N Query , something like this:
WITH got_nums AS
SELECT table_x.* -- or list columns wanted
, ROW_NUMBER () OVER (ORDER BY call_date ) AS a_num
, ROW_NUMBER () OVER (ORDER BY call_date DESC) AS d_num
FROM table_x
WHERE mobile_no = 989
AND call_date >= DATE '2013-04-25'
AND call_date < DATE '2013-04-26' + 1
SELECT * -- or list all columns except a_num and d_num
FROM got_nums
WHERE 1 IN (a_num, d_num)
;This forum is devoted to the SQL*Plus and iSQL*Plus front ends. This question doesn't have anything to do with any front end, does it? In the future, you'll get better response if you post questions like this in the PL/SQL.
I hope this answers your question.
If not, post a little sample data (CREATE TABLE and INSERT statements, relevant columns only), and also post the results you want from that data.
Explain, using specific examples, how you get those results from that data.
Always say which version of Oracle you're using (e.g., 11.2.0.2.0).
See the SQL forum FAQ {message:id=9360002} -
Hi All,
I have requirement to write code for date range.
Characterstic = Run-Out Date, it was created reference to 0Date.
Requirement is data should load depends on Run-Out Date 7 days old and 14 days future.
Logic is -7 days old >= Run_out date <= 14 days future.
please let me know how I need to proceed with ABAP code for this requirement.
Thanks.
Please do not ask for ABAP code here. Its not a training forum
Edited by: Pravender on Aug 18, 2011 1:46 AM>
Sree vignesh wrote:
> Hi,
> In the select option we have a field month range as
> SELECT-OPTION : FROM 01.2007 TO 01.2009 " Let say Ur Selection option is SO_MONTH
> but now i need to add the DMBTR field considering the month range in the SELECT OPTION i.e., only FROM 01.2007 TO 01.2009 i mean without 2006 data.
>
> LOOP AT LT_DATA WHERE month in SO_MONTH. " Here add a Where condition
> ls_output-matnr = lt_data-belnr.
> ls_output-werks = lt_data-bukrs.
> ls_output-lgort = lt_data-dmbtr.
>
> COLLECT ls_output INTO lt_output .
>
> ENDLOOP.
>
> please help with code .
>
> thanks in advance.
Regards,
Suneel G -
MDX Query for Top 10 in SSAS Project
Hi Guys,
Please I need an MDX query that will help me calculate Top 10 inside the SSAS project.
Your help will be greatly appreciated.
Thanks
meHi,
I know nothing about PowerView and PerformancePoint Server but I played with Excel and I am able to use the named set I created. Here are the steps which I followed.
1 - Create the named set. Remember... this name set appears inside the dimension which you use as the first parameter inside TOPCOUNT function.
2 - Deploy the cube and perform a process full.
3 - Navigate to PowerPivot ribbon and click on PowerPivot Window.
4 - Choose From Database > From Analysis Services or PowerPivot. Specify the necessary SSAS server credentials and connect to the Cube which you are interested.
When it comes to the MDX query design window you construct your MDX code in SSMS and copy that code. You also can use the design mode as well. In this case you have to toggle the "design mode" option and enter to manual mode which you can type
your MDX code. Here is a screenshot of that.
5 - Validate your query and click Finish. Once the data is in you can create your power pivot report. Here is an example.
I hope this helps to troubleshoot your issue.
Best regards...
Chandima Lakmal Fonseka -
Dynamic Date Value for Date Range Parameter - Scheduling in BI
Hi,
I am New to BO Enterprise XI R3. I want to schedule the Crystal report which takes Date Range as parameter. Is any option available to calculate From Date automatically based on Current Date based on the range required?
Currently, Parameter option accepts parameters and enterprise process the report for configured parameters. In this case, report always prints only for configured date range eventhough report generated after one month. I am expecting report has to print data for date range (eg. 1 weeks, 4 days, or any range) based on system current date.
Thanks in Advance,
Venkateswaran.PI'm am in the same situation. I need to be able to have the date parameter dynamically change based on the current day's date when I schedule a report. However, because this parameter comes from a Stored Procedure from the database, it cannot be modified in the Report Designer (as far as I know). I've tried to set a default for it to use "currentdate" but it doesn't seem to take. Anyone know if this can be accomplished in the scheduler?
Thanks
-Tom -
Forum search doesn't seem to work for Date Range 'ALL'
Hi there,
Forum search doesn't seem to work for Date Range option: 'ALL' .
For a given search criteria, I get few search results when the date range is chosen as 'last year', but for the same search criteria, when the date range is chosen as ALL, no search results are shown (not even the ones shown earlier for last year selection).
regards,
AJCan you please delete my few duplicate replies in [CJ20n|Re: Long Text at Activity Level in CJ20N] thread?:-)
Cheers,
Amit. -
Which BW variable is used for date(range) when creating a portal service
Hi,
Can any one please let me know which BW variable is to be used for date(range) when creating a portal service for searching based on dates.
Thanks
AbhaiHi Arun,
its just a portal service which would be called when searching a document created on a particular date or betwwen a range of date.so what i require is which BW variable to be used when handling range.As for variable technical name we use VAR_NAME_I and for single value variable we VAR_VALUE_EXT_I
in the similar manner i want BW variable to be used for range of values.
Thanks
Abhai -
User Prompt for Date Range in Bex Query Analyzer
I have a workbook that has two queries. The queries both require the user to enter a date range upon refresh. I want the user to be able to hit refresh, enter the date input into the dialog box and then both queries to use this date range for their input. I have seen this in other book, but when I click refresh on my book it only runs the first query. How do I get the second query to use the first queries input?
use the same variable in both the queries. this will let the user enter the date in a single variable and this will refresh both the queries.
rgds, Ghuru -
MDX query for to get the data from two cubes
Hi
Can you tell me how to create MDX query to get the values from two cubes. (One hierarchy from first cube and one hierarchy from second cube)
Can you give me one example.
Regards,
Madhu.
SudhanHi Sudhan,
According to your description, you want to retrieve data from two different cubes, right? The short answer is yes. To query multiple cubes from a single MDX statement use the LOOKUPCUBE function (you can't specify multiple cubes in your FROM statement).
The LOOKUPCUBE function will only work on cubes that utilize the same source database as the cube on which the MDX statement is running. For the detail information about it, please refer to the link below to see the blog.
Retrieving Data From Multiple Cubes in an MDX Query Using the Lookupcube Function
Regards,
Charlie Liao
TechNet Community Support -
Query using Between for date range
Hi,
I need to list a date range of registration.. i entered
4/12/2007 (as value for form.regstart) and 7/12/2007 (as value for
form.regend)..
WHERE dateregistered BETWEEN #CreateODBCDate(form.regstart)#
AND #CreateODBCDate(form.regend)#
the result that i got was only from 4/12/2007 to 6/7/2007..
however when i run the same coding at mysql.. it works
perfectly..
any idea?Turn on debugging and see what dates show up in the sql that
went to your db. Cold Fusion might be confused by your date format.
I certainly am. -
How to use 2 Dropdown box in webapplication for date range selection
Dear all,
I am working on a report that will show 2 drop down boxes. These should be used as a date range.
This works fine if I use 2 variables as a date range on 0CALYEAR. However I dont want the user to fill in the dates but selecting the dates with 2 drop down boxes.
I cannot manage to get this to work. I saw some comments about user exits in the forum but I cannot figure it out if there is an easier way.
Could you give me an idea of what to do?
Thanks a lot,
AndreasHi,
If you want the user to select the date directly rather than entering, you need not to have a dropdown menu in WAD. Directly go to the query which you have selected for the object in WAD, there create a variable with calendar. Put it mandatory, so that the user selection of the date will be mandatory. The variable will be automatically be available when you execute the template inn the browser.
Assign points if this helps u.
Regards,
Koundinya. -
MDX query for parent-child combination display
Hi guys..
I am really new to the Essbase technology.
Could you please help me out with this one:
is it possible to extract the data(for example the metadata of a outline)..eg:-
The outline structure is as follows :
A1
A11
A12
A2
A21
A22
I want a MDX query to display it as :
A1 A11
A1 A12
A2 A21
A2 A22
I have tried various ways but couldnt come up with a query for this.
Thanks in advance for all your help.Unfortunately MDX cannot do this. If you think about what you are asking for, you are essentially saying that you want to see members of the same dimension on different axis. Multi-dimensional queries can't do that (think about trying to do it with addin).
A further limiation is that MDX is not robust enough to allow you to work the results into a single axis using a concatenation function because while there is a string-to-member function, there is no member-to-string function and concat requires a string as input.
Other approaches would require MDX to support joins or subqueries, which it does not.
As others have mentioned, to do what you want to do, you need outline extractor or something like that.
*Fun fact - if you have OBIEE 11g, it can do reporting in Essbase with hierarchy members in hierarchy format or column format, which will give you the results you need. That alone is good reason to start using OBIEE.
Maybe you are looking for
-
A10 Hard disk failure and replacement - How do I use Recovery Disks?
I have a Satellite Pro A10 which has suffered a hard disk failure. I have replaced the hard disk drive (with a non-toshiba drive) but cannot load the operating sysytem etc from the recovery disks supplied with the computer when new. When starting the
-
Urgent help on URL Execution BPS-STS
Hi Experts, I have customized all the STS setting and went through several notes, checked all the setting for Service Tunguska. Since we are using HTTP and HTTPS both the Protocol, I went through OSS Note 984708 and did all the settings accordingly.
-
Macbook Pro or Macbook Air?
I´m studiyng digital animation and i don´t know which Macbook is the best for it. My friend says that is better the Air. But i think the Pro is the best becuse i saw that the programs of design are very heavy. What do you think?
-
How to use JDBC to access "returning " clause
I think it is important to note here that you DO NOT have to use SQLJ for this. You can achieve the same result in plain JDBC. You must put the PL/SQL block in a CallableStatement object. e.g. CallableStatement cs = conn.prepareCall("declare myReturn
-
Subscription notification email - deleted clicking on link - Urgent
Hi All, We are using NW04 Portal SP11, we are using Subscription service, everything is fine except one issue.. when we subscribe a document, we are getting an email with the link "CR.txt" Subscription Administration generated this notification: The