To retrive previous month based on month prompt
Hi,
My universe is based on SAP BEX query. I have a requirement to report the previous month data based on a month prompt. Since the universe is based on the MDX, could anyone suggest a way to calculate previous month from universe.
Appreciate your responses.
Regards,
VyshBO
pvinesh wrote:
Hi VyshBO,
>
> You can refer below syntax and prepare a filter object in universe to get Previous Month.
>
>
<FILTER KEY="[ZMONTH].[LEVEL01].[[ZMONTH]].[Value]"><CONDITION OPERATORCONDITION="Equal"><CONSTANT CAPTION="-1"/></CONDITION></FILTER>
>
>
> Regards,
> Vinesh
Can you explain that syntax, Vinesh? In particular, what does the [[ZMONTH]] imply?
Similar Messages
-
Previous month end based on prompted values
Hello All,
I need to create a SR report that shows:
Received in current month: count of Service requests recorded in current month selected. For instance if date prompt selection was March 2010 then count of SR recorded from Mar 1- 31,2010
Open Service Requests at month end Count of SRs where "Date Completion entered in system" is null as last day of month selected(eg March 31)
Carry over from Previous month: same as Open Service Request as month end less one month.( eg Feb 28)
I currently have a prompt which lets the end user choose the Month and Year they want to run the report for. I am getting the right values in my first two columns but my carry over is giving me problems. Any idea how I can write a formula for 'Carry over from Previous month'??
Any help is appreciated!
SoniaHi Max,
The carry over is causing problems. However, the formula for the month end chosen is
SUM(CASE WHEN CAST ("Service Request"."Closed Date and Time" AS DATE) IS NULL OR CAST ("Service Request"."Closed Date and Time" AS DATE) > TIMESTAMPADD (SQL_TSI_MONTH, 1, (TIMESTAMPADD (SQL_TSI_DAY, - (DAYOFMONTH(CAST ("- Service Request Custom Attributes".INDEXED_DATE_0 AS DATE))), CAST ("- Service Request Custom Attributes".INDEXED_DATE_0 AS DATE))))THEN 1 ELSE 0 END)
But when I use this formula for previous month (-1).. It does not work. It gives me zero.
Thanks!
Sonia -
OLAP Universes - Based on BEx Query - Month and Previous Month Functions
Hi,
I created a Universe based on SAP BEx queries and I like to create a filter so that I use in Web Intelligence report to run for "Previous Month" data always. There are "Date" filelds in BEx Query(No Month info only date data). I have no knowledge of SAP BEx Queries and new to OLAP universes. Could you help.
How to create filter that show Previous Month.
Nanda Kishore
Edited by: Nanda Kishore B on Dec 26, 2010 6:15 AMThe easiest way (but NOT the most efficient one) is to create a local variable (Dimension) in your report with the following code:
=if (Month(CurrentDate())=1 AND Month([[MyDate]])=12 AND Year([[MyDate]])=(Year(CurrentDate())-1)) OR (Month(CurrentDate())>1 AND Month([[MyDate]])=(Month(CurrentDate())-1)) then 1 else 0
where MyDate is the field from your query containing the data information
Activate the report filter area in your report design panel by pressing the Report filter icon and drag and drop your variable there and apply it to the entire report. Filter value 1 and you will get the data for the previous month.
Keep in mind that this approach is not optimal especially if you do have many rows of data delivered to your WebI report because filtering takes place only AFTER the data is retrieved. The Best practice here is to work with BEx variables.
How many rows of data does your WebI report normally fetches?
Regards,
Stratos -
Hello,
We need some help with an SSAS MDX query based on date logic. One of the problems is that I don't have access to the Cube but have been given a query example with the logic needed for the calculation. Here's the scenario;
The ETL process will run on the first Tuesday after the 15<sup>th</sup> of a given month. The Analysis Cube data queried should include the current year up to the end of the previous month. For example, on May 19<sup>th</sup>
(the first Tuesday on or after the 15th) the query should include data from January 1<sup>st</sup> through April 30<sup>th</sup>.
The 15<sup>th</sup> of the month is not part of the query, it is a factor in when the query is run. The query will always be in terms of complete months.
SELECT
NON EMPTY { [Measures].[Revenue Amount],
[Measures].[Utilization],
[Measures].[AVG Revenue Rate],
[Measures].[Actual Hours] }
ON
COLUMNS,
NON EMPTY { ([dimConsultant].[User Id TT].[User Id TT].ALLMEMBERS * [dimConsultant].[Full Name].[Full Name].ALLMEMBERS * [dimConsultant].[Employee
Type].[Employee Type].ALLMEMBERS ) } DIMENSION PROPERTIES MEMBER_CAPTION,
MEMBER_UNIQUE_NAME
ON
ROWS
FROM
( SELECT
( { [dimDate].[Week Date].[1/4/2015], [dimDate].[Week Date].[1/11/2015], [dimDate].[Week Date].[1/18/2015], [dimDate].[Week Date].[1/25/2015], [dimDate].[Week Date].[2/1/2015] } )
ON
COLUMNS
FROM
( SELECT
( { [dimIsBillable].[Is Billable].&[True] } )
ON
COLUMNS
FROM
[SSASRBA]
WHERE
( [dimIsBillable].[Is Billable].&[True], [dimDate].[Week Date].CurrentMember ) CELL PROPERTIES VALUE,
BACK_COLOR,
FORE_COLOR,
FORMATTED_VALUE,
FORMAT_STRING,
FONT_NAME,
FONT_SIZE,
FONT_FLAGSHi Hans,
Thank you for your question.
I am trying to involve someone more familiar with this topic for a further look at this issue. Sometime delay might be expected from the job transferring. Your patience is greatly appreciated.
Thank you for your understanding and support.
Regards,
Simon Hou
TechNet Community Support -
Calculating receipts from previous month based on the sales of current mont
Hi Gurus,
I have a requirement where i need to display sales for a quarter and need to display receipts from the previous quarter. For example consider that i am displaying sales from week1-Aug to Week4-October, I need to display receipts ( R_Net_RCPTS) from Week1-july to Week4-September. In that way If i select Wk1-Aug for sales it should display Wk1-july receipts. i need to do this in Webi by creating appropriate variables.
I have got prompts on year and Fiscal Week
I have given year as 2011 and The "08: Fiscal Week From:" as "Wk1-Aug" to "08: Fiscal Week To:" as "Wk4-Oct"
I HAVE GONE THROUGH ALMOST ALL RELATED THREADS, BUT COULDN'T FIND ANY SOLUTION. ITS REALLY URGENT. PLEASE HELP ME AND I WILL FOR SURE GIFT POINTS.HI
Your explanation is not clear whether u want to display current quarter data or you would like to see only previous month data ?
Which dimension you are taking for week ? how data would be like ?
Edited by: K.sunil on Nov 21, 2011 9:14 AM -
Compare turnover actual month with previous month on monthly based report
Hello Gurus,
please help me with the following requirment:
In have a monthly based report with key figure 'turnover'. Now I want to calculate deviation turnover actual month vs turnover previous month from last year. How to handle this?
Example:
CalYear/Month
01.2010 02.2010 03.2010 04.2010
Turnover 10 20 15 20
Calculated xxxx xxxx xxxx xxx
Thank you very much!
MuammerHello voodi,
it doesn't work. With offset function it shows the turnover only in the columns from last year. I need the turnover from last year in the columns from this year. Any ideas?
Expected:
CalYear/Month
01.2010 02.2010 03.2010 04.2010
Turnover 10 20 15 20
Turnover last year xxxxx xxxxx xxxxxx xxxxx
With offset -12
CalYear/Month
01.2009 02.2010 ... 01.2010 02.2010 03.2010 04.2010
Turnover 20 50 .... 10 20 15 20
Turnover last year 20 50 ... blank blank blank blank
Thank you!
Muammer -
Rolling 18months report based on the month prompt.
Hi All,
In one of the requirements in OBIEE, I have to create a report of rolling 18months. Now the challenge is that I will not be taking sysdate in here to calculate the rolling 18 months. I need to take the value of a month prompt on dashboard for calculation and fetch the 18 months rolling data in the report.
E.g: If the user selects Dec-2009 in the month prompt on dashboard, I need to fetch data from July-2008(which is 18 months from Dec-2009) to Dec-2009.
I will be passing the value of the month prompt in a presentation variable in the report, but can I calculate the 18 months prior month on the fly to put in the filter to fetch data? If yes, then how?
I have also created a calculated logical column in the rpd that calculates 18 month earlier date for each date. Now the question arises, how to use filter on this column so that it selects only the month which will be 18 months prior to the selected month prompt on the dashboard so that the data gets fetched for the report?
Thanks in advance,
SumitaHi,
Please check out the following blog :
http://shivabizint.wordpress.com/2008/09/19/rolling-months-data-for-year-month-prompt-in-obiee/
Another way I have done it is follows,
On my time dimension, which is at day level, for each given row (day) I derived the rolling period start date and the rolling period end date (which was always previous friday for a given day).
I created a simple report with the following :
Day, Rolling 6mth Start Day, Rolling 12mth Start Day, Rolling 18thmth start day, Rolling End Date.
With day 'is prompted'
In the dashboard reports, you use complex filters to say the day range you are interested in is between 'Rolling X Start date' (6, 12 or 18mth) and Rolling Period End date on the filter query created in the step above.
When the dashboard prompt Go is selected, OBIEE runs the filter query to determine the start and end ranges and these are passed to the dashboard requests to achieve rolling period ranges from a Date prompt. - Im pretty sure you could use a similar method but using a month selector prompt, rather than my day prompt - The theory is the same.
Good luck !
Alastair -
Parameter for Current Month and Previous Month
I'm trying to create a parameter for current month and previous month based on the ex_date, but not sure what i'm doing wrong.
where ex_date = @SelectDate
I created a second dataset below for the values in the parameters.
SELECT Month(CURRENT_TIMESTAMP) AS 'Month', 'Current Month' as 'Current Month'
union all
SELECT Month(CURRENT_TIMESTAMP)-1 AS Month, 'Previous Month' as 'Previous Month'
Results
Month Current Month
3 Current Month
2 Previous Month
Once I preview it I get "Conversion failed when converting date and/ or time from character string" I changed the data type to "date/Time" but that did not make a difference. The date is convert (varchar(10), ex_date, 101) so looks like
11/12/2014.
I've also tried expressions like =month(now()) to pull current month with same error so i'm not sure what i'm doing wrong. Any ideas?i tired this real simple report
in the first dataset - my main report query - select name from sysdatabases where month(crdate())=@month
in the second dataset - select month(getdate()) as Month1
in the parameters - choose int data type and available values - select the second data set
in the first data set- add this parameter..( i am assumming you know this, since you have done)
in the preview you should get the drop down with current month number - 3
and if you run the report, it will display the database names that were created in march. remember we are no checking year, so will get all that were created in march across the years.
Hope it Helps!!
I'm looking to have the dropdown say "Previous Month" and "Current Month" as a option. I know how to get the information in SQL, but not sure how this translates or put into a parameter.
Current Month
list_date BETWEEN
DATEADD(MONTH, DATEDIFF(MONTH, 0, GETDATE()), 0)
AND
DATEADD(MONTH, DATEDIFF(MONTH, 0, GETDATE()) + 1, 0)
Previous Month
list_date between
CONVERT(varchar,dateadd(d,-(day(dateadd(m,-1,getdate()-2))),dateadd(m,-1,getdate()-1)),106) /* Last Month */
and
CONVERT(varchar,dateadd(d,-(day(getdate())),getdate()),106) -
How to get the last day of the previous month
Hello Team,
If my input date is today , then i need to find out the last day of the previous month for the same.
Can someone help me to find out .. how can this be done.
Regards,
RaviHi,
Try the below code.
// get a calendar object
GregorianCalendar calendar = new GregorianCalendar();
// convert the year and month to integers
int yearInt = Integer.parseInt(year);
int monthInt = Integer.parseInt(month);
int dayInt = Integer.parseInt(day);
// adjust the month for a zero based index
monthInt = monthInt - 1;
// set the date of the calendar to the date provided
calendar.set(yearInt, monthInt, dayInt);
int day = calendar.getActualMaximum(GregorianCalendar.DAY_OF_MONTH);
return Integer.toString(day);
Regards
Venkat -
How to show a report for 'Previous Month' Data
Hi Gurus,
I have a requirement, where i have to default my report to show previous month data.
Scenario:
My prompts by Default are set to CURRENT (current year,quarter,month). once the user logs in, the report should display data for month 'Nov' instead of 'Dec'.
I tried using TIMESTAMPADD() in the formula , but it didn't work, though i don't see any error. Not sure if i 'm missing something.
Is there a way to achieve this.I 'm using OBIEE 11.1.1.6.
Any help is highly Appreciated ! Please.
Thanks,
RamyaFrom what you wrote I am assuming the user can manually save the report results to the Excel file.
If your report uses ALV Grid it is possible to export the data to a spreadsheet (one of the functions available in the ALV tool bar).
If you have used WRITE statements it is also possible to save the output as a spreadsheet (menu System -> List -> Save), but the latter will not produce as nice a spreadsheet if the data don't form a matrix. In other words, some work may be necessary in the spreadsheet afterwards before it has the format your user wants. -
Variable last date of previous month/last date of current month
Hello Experts,
I am facing an issue while designing a query.
Requirement is like this.
Report will be run on monthly basis.so on execution of report, it should prompt for month/year.
now on report there are two columns for which I have to get data on date basis(last date of previous month and Last date of current month).
Can anyone tell me is there any standard variable for this? what is it?
or how to achieve this?
Regards,
NiravHi,
See if this post in this forum can help you.
Re: Last date of a month
Regards
Shalabh Jain -
How to find first and last day of previous month?.
Based on current month, I want to find start and end day of
previous month.
For example,
For august, Start date is July 1st and End date July 31st.
How can i get first of previous month as start date and last
day of the previous month as end date?.
Same way,
i want to find start date of current month and end date of
next month.
Example:
For august,
i want to get start date, august 1st and end date : september
30.
How can i do this from current date or now().
I am looking for best and easy way to find start and end
dates..
Thanks<cfset today = now()>
<cfset firstOfThisMonth = createDate(year(today),
month(today), 1)>
<cfset lastOfNextMonth = dateAdd("d", -1, dateAdd("m", 2,
firstOfThisMonth))>
<cfoutput>
today = #today#<br>
firstOfThisMonth = #firstOfThisMonth#<br>
lastOfNextMonth = #lastOfNextMonth#<br>
</cfoutput>
Edit - To find the start and end day of previous month, get
the first of THIS month. Use Subtract 1 month ("m") to get the
start date. Subtract 1 day ("d") to get the end date. -
Display Month and 12 previous Months
I am trying to create a report (CRXI) which will display month data for the current month and the 12 previous months. I am going to use subreports (similar to a calendar report) but am having trouble displaying the 12 previous month, year headers.
I get the current month, year from a prompt date and then need to decrease a month for 12 months.
Any help would be appreciated.Hi Martha,
If you want to create a report for last 12 months and don't want to include present month then use the record selection for main report as
(month({DateField}) < month(currentdate)
and
year({DateField})= year(currentdate))
or
(month({DateField})>=month(currentdate)
and
year({DateField})=year(currentdate)-1)
and in the subreport use the record selection to get current month date as
(month({DateField}) =month(currentdate)
and
year({DateField})= year(currentdate))
Regards,
Raghavendra -
Show data of last day of previous month against any day of current month
Hi,
I have fact table which contains data at date level (we have data for oct-2009 to april-2010). Our requirement is to show data of last day of previous month against any day of current month in obiee 11g. I am facing problem in Feb 2010 its picking data of 28-Jan-2010 instead of 31-jan-2010 and for April its picking data of 30-mar-2010 instead of 31-mar -2010.
Any suggestion ???You're asking to filter your data set to only include rows between:
1) last day of the previous month
2) any day of the current month
This can be achieved with prompting in OBIEE Answers.
last day of previous month = TIMESTAMPADD( SQL_TSI_DAY , -(1), TIMESTAMPADD( SQL_TSI_DAY , DAYOFMONTH( CURRENT_DATE) * -(1) + 1, CURRENT_DATE)) . The problem is you need to make query work within Oracle's Answer syntax.
In the prompt, select the operator type for your date dimension as 'between' and default to 'SQL Results'.
For the 'last day of previous month' , use the query:
SELECT
case when 1=0 then Time."Fiscal Date" else TIMESTAMPADD( SQL_TSI_DAY , -(1), TIMESTAMPADD( SQL_TSI_DAY , DAYOFMONTH( CURRENT_DATE) * -(1) + 1, CURRENT_DATE))
end
FROM ENTER_YOUR_PRESENTATION_FACT_FOLDER_HERE
For the current date, use the query:
SELECT
case when 1=0 then Time."Fiscal Date" else CURRENT_DATE
end
FROM ENTER_YOUR_PRESENTATION_FACT_FOLDER_HERE
Another option is to create a last_date_pervious_month variable in the RPD and have that as the default value in your prompt. -
Calculating count during previous months
I am working on a report where we need to track the number of tickets that were open at the end of previous months. I have calculated those tickets that were closed in the same month by comparing the month of the ticket's creation date with that of the ticket's close date using a CASE if:
CASE WHEN MONTH(ticket_fact.Modified) = Month(ticket_fact.Created) THEN 0 ELSE 1 END
How do I get just the count of all the tickets for this. I have results in a table but now each row shows a 0 or 1 and Pivot table does not seem to work as well.
If I use Status then I get the status that the ticket is currently in.
Thank you so much.OK, based on what your are asking and what you have done, I have to ask if what you are trying to do is what you really want to track. For one thing, your approach only works "this year." Once the new year comes, using the MONTH function will get you the counts of both "this year" and "last year." So counting only using the "months" of the dates is not correct. You would need the YEAR function as well.
Second, if you want to know if tickets are being closed in a reasonable amount of time, then you don't want to track just tickets that "opened and closed in the same month." Why? Because what if a ticket opened two days before month end and closed three days later? Wouldn't that be pretty efficient? Yet your report won't track that since the created and closed dates are in different months.
What I would suggest as a better report is to track tickets that close within certain breakpoints in time, regardless of what day of the month it opened, for example, how many tickets were closed within 30 days? How many were closed in 60 days? etc. This report would give you a better analysis than tickets opened and closed in one month.
You would need to categorize your tickets with a CASE statement similar to the following:
CASE WHEN TIMESTAMPDIFF(SQL_TSI_DAY, ticket_fact.Created, ticket_fact.Modified) < 30 THEN 'Less than 30 Days' ELSE CASE WHEN TIMESTAMPDIFF(SQL_TSI_DAY, ticket_fact.Created, ticket_fact.Modified) < 61 THEN '30 - 60 Days'...
This is what you should count.
Maybe you are looking for
-
6550b replacement screen 1600 x 900 not working.
I have a HP6550b and the original screen has broken. The original screen had a resolution of 1366 x 768. I read from the specifications that this laptop can also support a resolution of 1600 x 900. However, if I try a new screen with the 1600 x 900 r
-
Installation of SAP Netweaver trial on not englisch windows OS
Hello I'm trying to install SAP Netweaver Portal trial on a not english version of Windows XP (German version). I get following warn message from the installation checker: Checking the names of selected well-known groups. The following names were exp
-
Safari quit unexpectedly and won't reopen
While taking an online course, I clicked to download a tool and Safari quit and I can't get it to reopen. This is the report that shows up: Process: Safari [553] Path: /Applications/Safari.app/Contents/MacOS/Safari Iden
-
Hi All I want a small carification.IS process codes required for inbound interface.Please advise regards kumar
-
Error in extracting 0PROFIT_CTR hierarchy data
Hi, I was trying to extract 0PROFIT_CTR Hierarchy. But it is giving following error msg. So guide me how to solve it. Error in the hierarchy structure: see error log The node name for ID 00001634 contains invalid characters