Cognos filter to last fiscal week - cognos

We're self learning cognos 11 currently and trying to work out how to use an advanced filter for last fiscal week. We run Sunday-Saturday and would want to always show last week no matter what day we run the report on

Hoping that I am not actually doing someone's homework. You can try the following expression:
[Date]> _add_days(current_date,-_day_of_week(current_date,7)) and [Date]<=
_add_days(_add_days(current_date,-_day_of_week(current_date,7)),7)

Related

Boomi / Groovy - Calculate YTD hours based on custom date

Using Dell Boomi, I'm pulling in a report for an integration I'm working on. This integration requires YTD hours, but starting on July 1st.
In order to do this, I know that I need to pull in all the data (to be safe) for current and previous year in order to have the full data set, but am unsure of what I need to do in order to calculate the hours and that the hours reset every July 1st automatically. I'm assuming that I will need either a custom map function to do many things or use a groovy script.
Any and all help is greatly appreciated.

Cognos Query to calculate a run date

So in my Cognos report I have a column 'Last Separation Date'. I want run a query on that column to calculate to all persons currently employed or separated from employment within the last two years. However, this date query should auto run to the day I'm running the report. For example. I run the report today 2/22/2020 and view data for the last two year till 2/22/2018. I login few days later to view the report on 3/1/2020. The report should pull data from 3/1/2018.
Create a filter with the between function using current date and some expression which determines a date two years in the past.
https://www.ibm.com/support/knowledgecenter/SSEP7J_11.0.0/com.ibm.swg.ba.cognos.ca_mdlg.doc/c_sql99_current_date.html#sql99_current_date
_add_years or _add_days might be handy as they take negative numbers.
Using the previous answers suggestions, your detail filter would be similar to
[Last Separation Date] between current_date and _add_years(current_date,-2)

How to display reports between two different dates on a monthly basis?

The problem that I'm facing currently is I have a start date and end date for multiple different items. What I want to do is be able to see when a report would be due at each given month that it's accounted for with a end report (+14 days from end date). For example:
The Lookup tab that I have for reference of the dates above to be able to match the months looks like this:
Now I'm having trouble creating a formula that would actually work with this. If I'm thinking correctly it would be something like,
IF Start Date != Start Month then IF Start Date is between March Dates, "Report", . . . IF End Date hits, add 14 days, then "End Report" on given month after 14 days.
So for the example above the outcome would look like the following:
This is the end result that I would want in the end. Due note that August for Battlefield 5 is supposed to be blank due to the game ending on 8/19/2018, +14 days for a end report: 9/2/2018 is the End Report date so their would not be a Report in August for that given scenario. (I think this is possible but not 100% sure for the August scenario)
I am open to any kind of formulas/Arrays/VBA's that would accomplish this task. I'm just having difficulty coming up with a solution for this that has been bugging me for a while, so any help is much appreciated!!
If anything needs to be further explained please let me know and I will do my best as an edit to this post.
-Maykid
Based on what you explained, you could just have a simple formula as such (no need for VBA):
LOCALISATION OF THIS FORMULA (E2) UNDER FEBRUARY 2018 in the picture attached
=IF(AND(MONTH($C2)=MONTH(E$1),MONTH($C2+14)=MONTH(F$1)),"",IF(AND(MONTH($C2+14)=MONTH(E$1),YEAR($C2+14)=YEAR(E$1)),"End Report",IF(AND($B2<E$1,($C2+14)>E$1),"Report","")))
And then you can drag this formula.
I hope it helps.
BR

Excel - Finding nth day of specific month from any day of the year

I'm creating a daily scheduling report. Not every position in the report has to be staffed every day, but there's rules determining this (daylight savings mostly) and I've been pulling my hair out trying to figure out a good way to do this that will make it anyone-proof for the person that needs to fill out the sheet on any given day.
My issue: Starting the first sunday in november, one position doesn't need to be staffed all the time. This continues until the second sunday in march. I want the box that shows this position to be conditionally formatted based on what today's date is (which is shown in E1 using =Today() )
I got something close to working (though it looks disgusting), and would cite sources, but I just came back to working on this project after a couple months of a different assignment:
=IF(MONTH(E1)>10,AND((DATE(YEAR(E1),11,1+7*1)-WEEKDAY((DATE(YEAR(E1),11,8-1))))<E1,E1<(DATE(YEAR(E1)+1,3,1+14*1)-WEEKDAY((DATE(YEAR(E1)+1,3,8-1))))),AND(DATE(YEAR((DATE(YEAR(E1),11,1+7*1)-WEEKDAY((DATE(YEAR(E1),11,8-1))))-1),MONTH((DATE(YEAR(E1),11,1+7*1)-WEEKDAY((DATE(YEAR(E1),11,8-1))))),DAY((DATE(YEAR(E1),11,1+7*1)-WEEKDAY((DATE(YEAR(E1),11,8-1)))))),E1<(DATE(YEAR(E1),3,1+14*1)-WEEKDAY((DATE(YEAR(E1),3,8-1))))))
It seems to kick in during the SECOND Sunday in November. I'm particularly flummoxed now. It's been an interesting intersection of "I'm pretty good with computers and layout design" and now all of a sudden diving deeper than I'd ever thought i'd go in excel. Keeping that in mind, I'm starting to feel a little out of my depth already and I'm sure VBA could do this easily but I wouldn't know the first thing about what I'm doing which means if anything ever goes wrong because someone accidentally deleted something I won't be able to fix it.
TL;DR: Trying to hit a moving target of a date based off of a dynamic entry in E1. Based off of E1 find the first sunday in november and the second sunday in March of the following year (or i suppose current year once we roll back around to january)
=OR(DATE(YEAR(E1),11,15-WEEKDAY(DATE(YEAR(E1),11,1),2))<=E1,DATE(YEAR(E1),3,15-WEEKDAY(DATE(YEAR(E1),3,1),2))>=E1)
alternatively you can replace E1 in the formula with TODAY(). This equation will evaluate to True or False

Listing values regardless of prompt selection

I currently have a cognos report with 3 pages:
Monthly Summary
Monthly Detailed
Full Year Trend
The month is determined by a value prompt. My question is: How can I make it so the 3rd report page ignores the Month paramvalue and shows all 12 months regardless of the value prompt? So if June, for example, was picked the first two reports would show only June but the full year trend would show January to December.
Currently the prompt works fine for the two other reports but I can't figure out how to make the third page show the same data everytime.
Thanks,
lostintern
It will get tricky towards year-end/beginning, but anyhow ... Extract the value of Year from your prompt and use it as a filter for your third page query.

Resources