Cognos - Crosstab report broken out by DateRange (week starting on Sunday) - cognos

I've been working on this a while and I haven't found too much on the web to help so hopefully someone can assist.
I'm using Cognos 8.4.1 with SQL Server as a data source. I have a date field that holds date and time.
Our client would like to see the report broken out by week for the entire year, but with the week starting on Sunday, not Monday. To add to the complexity, I need to display the date range as the data label.
so for example the header of the cross tab would look like the below breakout, the totals in each column.
Week 1/5-1/11 | 1/12-1/18 | 1/19-1/25 | 1/25-2/1 |
Any assistance is appreciated, thanks!

So the ideal way is to in fact have a table with the calendar data in order to do this properly. This isn't something I can add to our Cognos environment overnight, so in interim I've come up with a temporary solution. Instead of displaying the week range, I'm displaying the start of each week (Sunday).
I created a new data element calling it [DayOfWeek]:
_day_of_week([mydatefield], 7)
Then I created another data element calling it [StartOfWeek]:
cast(CASE [DayofWeek]
WHEN 1 THEN [mydatefield]
ELSE _add_days([mydatefield], -1 * ([DayofWeek] - 1))
END,date)
My biggest challenge was using the add days function because I started with DATEADD, the native function of SQL and it wasn't working.
Thanks everyone for your input!

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.

Amazon Quicksight Dynamic date filter

so everyday I receive sales data from the previous day. So today November 15 I have data from July 2021 until November 14 2021. What I want is to show this data for the current month by aggregating by day. I use a quicksight visual with a MTD (Month To Date) filter. Everything is fine so far.
The problem is on each first date of the month, I see "No Data" on my visual which is normal since I do not have any data from the current day/month but as I said earlier from the day before.
So what I want to achieve is:
Each 1st of current month: show data from the whole previous month
From 2nd to last day of current month: show data from the current month
Can someone help me please to know how I can achieve this?
I looked for ways to do this and I found dynamic default parameters but this option is not fine with me since I have to fill a username column according to the documentation (https://docs.aws.amazon.com/quicksight/latest/user/parameters-set-up.html) and I have many users so it will be not interesting to list all of them.
You can assign parameters to a group rather than a specific user which is much quicker
There is new functionality which allows you to set today or beginning/ending of month/quater/year as default.
See screenshot:
enter image description here

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 create a 'past 3 months' time period in Google Data Studio

I'm trying to have my line chart show data for the past 3 months. GDS has a 'last quarter' date range, but this shows me Q1, Q2, Q3, or Q4. What I need is the data for the past 3 full months (not counting the current month). I tried creating a calculated field but the documentation isn't proving very useful for the matter at hand.
eg. If the current date is Feb-20, I want to show data from 'Nov 1 - Jan 31'. Also need to compare to same period from last year.
Can anyone help? Thanks in advance!
I don't think this is possible in the way you're describing. You can achieve the same by creating a metric in your data source and then applying a filter at the page / chart / report level to remove data which doesn't meet your criteria
You can use the option "advanced" in the date dropdown and set the start date to today minus 3 months.

Sharepoint 2007 date time in a list

We are using a custom list on Sharepoint where we require users to enter data with a date and time field. We have been facing huge issues in data validity when generating reports due to this field. Following are the kinds of mistakes:
Selecting AM instead of PM or vice verse. Changing to 24 hrs format doesn't help much because then the users select (as an example) 02:00 instead of 14:00 for 02:00PM.
There are errors regarding formats of dates, hence some entries have dates from the future or the past.
As the reports are generated each week, the list needs to be populated by the end of the week. If the month has changed between the week, people forget to change the month in the calendar and the entries are of the last week of the current month instead of the last week of the previous month.
Are there ways to configure the list(Pref. without programming) so that:
A. Only working hours are available in the time related dropdown.
B. Dates from the future are not allowed( Or not available)
Any help would be appreciated.
As far as I know, you won't be able to satisfy these requirements with no custom code.
If you decide to go down the coding path, what you need to do is create a custom field type. Let me know of you need help on this.

Resources