OBIEE Moving Average Drill Down - moving-average

I have created a graph to show 6 months moving average column for last 13 months
Now users want to drill on these 6MMAs for last 6 months data contributed to that moving average.
Say , for Mar 2016 the contributing months are 10/2015, 11/2015, 12/2015, 01/2016, 02/2016 and 03/2016.
So when user clicks on Mar 2016 data point they should see all contributing projects for that month i.e. 10/2015, 11/2015, 12/2015, 01/2016, 02/2016 and 03/2016.
For Feb 2016 the contributing months are 09/2015, 10/2015, 11/2015, 12/2015, 01/2016 and 02/2016.
So when user clicks on Feb 2016 data point they should see all contributing projects for that month i.e. 09/2015, 10/2015, 11/2015, 12/2015, 01/2016 and 02/2016.
And so on..
How can I achieve this?

Create one more analysis which will show data for all months/year.
And create a drill down from your master report which will be navigated to the detail report .
Also on what column basis you want to display your detail report ,give "column as prompted " there.It will be like "Master-Detail" analysis.
So when you will click on master report,that value will be passed as a parameter to detail report through "is prompted".And required value will be displayed.
PFB the link for detail explanation.
http://www.oracle.com/webfolder/technetwork/tutorials/obe/fmw/bi/bi1113/actionframework/actionframework.htm
Hope it is helpful.

you can try a work around.write a formula in your month column in your detail report. --Extract year from the presentation variable and month should be latest value of the month column and (month-5).Try with this. Try to create the detail report which will basically show the last 5 months data.and pass the variable accordingly. – mona16 12 mins ago
try some thing like this in your date column in detail report. use filter on you date column Time.Date <= cast(current_date as date) and Time.Date >= TIMESTAMPADD(SQL_TSI_MONTH, -3, TIMESTAMPADD( SQL_TSI_DAY , DAYOFMONTH( CURRENT_DATE) * -(1) + 1, CURRENT_DATE))

Related

SQL - Count month difference in non-consecutive date period

I am trying to extract how many months of membership a member gets up to date. As the picture shows, this member got four years of subscription since 2018. However, she stopped the subscription for a year ending in 2019. And then, restart the membership in 2020 again.
Each membership lasts for 12 months. if we look at the last membership starting from 2022-05-08, it will end up on 2023-05-08. However, I only want to get the total month count up to date(getdate - 2022-09-14).
Please advise how I could approach this matter. Thanks!
enter image description here
Assuming you were planning to apply sum(monthcount), you could wrap the monthcount within a CASE statement to checks if the vip_end is greater than today's date:
sum(case when vip_end > getdate() then ... else monthcount end)
What you do within that ... depends on whether you wanted to just count the different number of months within the date range (e.g. 31st Jan -> 01st Feb is counted as a whole month because it just considers Jan -> Feb):
datediff(month, datecreated, getdate())
or perhaps calculate the number of months based on the average days in a month:
datediff(day, datecreated, getdate())*12.0/365.25
or maybe something else... it really depends on what level of detail you want to achieve.

SQL - SUM two columns with a date range on one of the columns

First off its been a long week and I'm having a moment e.g. I just can't figure this out but I know its straight forward.
I have a CTE with a query for a GL Detail and one for Budget which are bought together to display all the details needed for a report.
For example the GL detail bring back the actual amount from a date range such as 2019-01-01 and 2019-04-01
and the budget part brings back the budget for each month so the date range is 2019-01-01 and 2019-12-01 as I need to sum up the total budget in a report.
Using an iif expression in SSRS the report shows the actuals up to the month a user select (there is on a to_date parameter)such as April then the report shows actual from Jan and then budget from May to Dec. I need to show the total of budget for the 12 month which is straight forward as I have bought each month amount back.
My question is I need to sum the GL actual amount for the months selected in by the user Jan to April and the remaining budget amounts May to Dec. For some reason I just can't work it out in my head.
Edit - I'm using
postgresql
SSRS - Microsoft SQL Server Reporting Services
columns are in GL is gldetail.amount and for Budget budget.amount_budget - I have a column in both gldetail and budget queries which is called post_date.
Worked it out -
,case
when src.post_date <= src._to_date then src.amount
when src.post_date > src._to_date then src.amount_budget
end as actual_budget_total
Then in the report sum the actual_budget_total

Selecting columns based on date in Sharepoint

I am very new to Sharepoint. I am working on a resource utilization list in Sharepoint , which helps managers keep a tab on utilization of their resources for each month . My list therefore has 12 columns for each month of the year. I want to create a view where in only the future 5 months from the current month are displayed. Therefore for example if the current month is August, I want only August,September,October,November and December columns to be displayed and the other month columns hidden.

extracting common data of current months and last two monnth sql

I have a table with more than 20000 rows, In one of column i have month from jan 2014 to Dec 2014, and in another column i have a loan number. Most of the loan Numbers are reapeting every months,now i need to get only the loan Number which are apperead in all three monthy consecutively. For eg if i am getting data for current months i also wanted get data which are common in two months before the current months. The database that i m using is Access DB. Any adivice will be more than a help, Thanks in Advance.
SELECT Loans.LoanID, Sum(IIf([period]=[month],1,0)) AS CM, Sum(IIf([period]=[month]-1,1,0)) AS [m-1], Sum(IIf([period]=[month]-2,1,0)) AS [m-2]
FROM Loans
GROUP BY Loans.LoanID
HAVING (((Sum(IIf([period]=[month],1,0)))>1) AND ((Sum(IIf([period]=[month]-1,1,0)))>1) AND ((Sum(IIf([period]=[month]-2,1,0)))>1));
I used month as an integer, and didn't make any adjustment for months 1 and 2 to loop back and look at prior year - you should be able to modify this based on the actual format you are using for the month.

KPI indicator for QlikView report update status. (Weekly and monthly updated)

I have two reports, one that is updated monthly from the source, and one that is updated once per week.
I have a KPI report that I want to show red/green indicators if the report is updated this month/this week.
The last updated date is stored in a table and is loaded into QlikView. QVD_Id is the id of the QV report.
The monthly report is beeing updated around the 10th each month. I have created this set analysis that seems to be "almost" working.
=if(Max({<Day=, Date=, QVD_Id={1}, MonthCounter={"<=$(#max(MonthCounter))"}>} num(Date(Updated))-1,00) >= num(Dato),0,1)
What I ultematly want for this indicator, is for it to be red if has not been updated within a month, or actually if its not updated within the 6th working day of the month it should be red(But this requered som additions to the dimensions that I can do later).
I tried to do the same for the weekly report, but its not working:
=if(Max({<Day=, Date=, QVD_Id={2}, WeekCounter={"<=$(#max(WeekCounter))"}>} num(Date(Updated))) >= num(Dato),0,1)
What I want with the weekly updated report, is that it should be red if it's not updated by the 2nd day of the week(Tuesday).
Example of the facttable used:
QVD_Id TotalLoad LoadYear LoadMonth LoadDay LoadHour Updated Date_Lnr Source
1 200000 2014 2 5 10 .02.2014 10:56:31 19759 Source1
WeekCounter is 58 this week, and MonthCounter is 2. (WeekCounter is just continiuing from last year but that does not matter here).
Hope any of you have some more experience then me with this and can find a solution for this.
i think this is close to what you want:
// check is date less than the 6 in the month and not larger than max date -1 month
if(num(weekday(Max(Date))) <= 6 and
num(weekday(AddMonth(Max(Date),-1))) <= num(weekday(Max({$}Updated))), 1,0)