How to exclude the February 29 - Leap Year in a Date column using Cognos 10 Report Studio? - cognos

How do I exclude the February 29 - Leap Year in a Date column in Cognos 10 Report Studio?
This is the column that I'm using for my date prompt
Below is the prompt that I applied on the date column
Depicted below is the details and properties of the date prompt that I will use to filter my report using the date prompt.
So all attributes and measures in the report are filtered using the start date and end date of the expiration date column I used on the report.
How do I avoid the February 29th to add up in my calculated columns (measures)? I want to get all calculation from January 1 to Dec 31 without february 29 that happens every four years? The February 29 data may or may not include a large amount but it has a ripple effect at the year end calculation. That's why I want to exclude Feb 29 included in the computation.

Here's a filter expression that will exclude "leap days":
not (extract(month,[Policy Expiration Date]) = 2 and extract(day,[Policy Expiration Date]) = 29)

Kindly try this.
([Policy Expiration Date] between ?Expiration Start Date? and ?Expiration End Date?)
AND
to_char([Policy Expiration Date],'mmdd') <> '0229'

Related

PowerBI Desktop: Cumulative of measures from the start of January to Selected Filtered date

I am looking for a way to get a cumulative count using powerBI dax formulas.
I currently have this measure:
[Tasks opened] = distinctcount(id number of tasks that are open)
When I select the filter month (May 2021), it only shows me the opened tasks in May 2021.
Example - Tasks Opened:
>Jan 21 - 5
>Feb 21 - 6
>Mar 21 - 8
>Apr 21 - 2
>May 21 - 7
>Total = 28
When I select the filter for May 21, I want the measure to show that it is 28 instead of 7, and if I select April 21, I want the measure to show 21.
Help is greatly appreciated! Thank you :)
Elaboration:
Basically I want a method where I will be able to filter the tasks opened based on the date selected on the filter.
When the filter month is May, I want to distinct count the number of incidents that has been open for more than 90 days as of 31 May.
It should change accordingly when the filter month is April, so it should distinct count incidents that has been open for more than 90 days as of 30 April.
It should include all the open incidents (whether it is created in Jan/Feb even though the filtered date is April etc).
I figured it should be like if created date is before filter date, resolution date is after filter date and the incident has been open for more than 90 days, that data should be taken into counter.
--> The issue arise where I cant seem to get the right date for the filter date. Currently I used a measure, but the End of Filtered Date seems to only be the last day of the month (i.e. if filtered month is may, the filtered date will be 31 May 2021).
Open incidents = IF(AND(incident_sla[Created]<=[End of Filtered Month],incident_sla[Resolved]>=[End of Filtered Month]),DATEDIFF(incident_sla[Created date],[End of Filtered Month],DAY),0)
The sample excel file can be found here: https://docs.google.com/spreadsheets/d/1wMLrvfAD1gUUIxljjBgcugJsG4o-w4nE/edit#gid=605277454
P.S. Sorry for the bad formatting, I'm not very familiar with using stack overflow.

Auto - sorting date in microsoft Excel 2016

I'm trying in excel something very simple but the answer seems more difficult?
At work we created an excel file and from left to right we can fill in details.
For example:
Date EmployeeName Status Comments
But I want that all cases are being automatically sorted by date. And then from the date of today and future ( explain this later at second ).
So for example today is 27 march 2020.
Case1: 1 april 2020 / EmployeeName / Status(open) / commments
Case2: 2 april 2020 / Employeename / Status(closes ) / comments
Now I fill in a new date lets say 29 march 2020. This should automatically pop up above 1 April 2020. However you need to manually click on the sorting table.
Second what if there are cases from before 27 march ( today's date ) can you make them disappear to the bottom of the list? Or in another tab in excel?
I believe that the easiest solution would be to write an if(...) statement to fulfill those terms in moving the selected dates. For sorting the dates I would recommend to have the date format in dd/mm/yyyy. So it would read 27/03/2020, instead of 27 March 2020. I find the default sorting of excel to work better with the number sequence in that format when sorting (ascending and/or descending) dates.

IIF Date falls BETWEEN two dates using SSRS

I am using SSRS 2016 and trying to compare a field to check if the Month falls between two parameters, as following:
=IIF(Format(Fields!FromDate.Value, "MMM") BETWEEN (Format(Parameters!FromDate.Value, "MMM") && (Format(Parameters!UnilDate.Value, "MMM") ), Fields!Days.Value, "0")
I have manually setup some fields in the dataset to display Jan to Dec. The aim is to show each result in its relevant month when you select the parameters: FromDate and UntilDate
What am I missing here?
I just replicated your scenario on my local report project.
Below is the expression you should try.
Note: What happens when your From date is June 2020 but To date is Aug 2019.
This will work because we are only checking months in between but not Years and so on.
But this should be a starting point for you to update your logic.
=IIf(Format(Fields!FromDate.Value, "MM")>= Format(Parameters!FromDate.Value, "MM")
and Format(Fields!FromDate.Value, "MM")<=Format(Parameters!UnilDate.Value, "MM"),
Fields!Days.Value,"0")
Edit for only current Year
=IIf(Year(Fields!FromDate.Value)>=Year(Parameters!FromDate.Value) and Year(Fields!FromDate.Value)<=Year(Parameters!UnilDate.Value) and Month(Fields!FromDate.Value)>=Month(Parameters!FromDate.Value) and Month(Fields!FromDate.Value)<=Month(Parameters!UnilDate.Value) , Fields!FromDate.Value,"0")

Filter dates by month in pivot table that doesn't start with the 1st of every month

Does anyone know how to filter dates by specific dates by month such as Jan 15 to February 15, Feb 15-March 15....etc on pivot table in excel?
My data is January 15 2017 to January 15 2018, so I like to filter it by specific dates but so far it's only letting me do the number of days which is not accurate since feb has only 28 days. thank you!

Microsoft Excel - Date Sequence

I had a look for this question before I asked, but sorry if it's a repeat.
In a spreadsheet, I want to employ a date sequence.
eg. Stock Arrives - Friday 22nd February 2013
then, on the 22nd of Feb, that date CHANGES to the next 7 days.
eg. Stock Arrives - 1st March 2013
and then repeats this indefinitely.
Is there any way to do this?
If you want to always show the next Friday you can use this formula
=TODAY()+8-WEEKDAY(TODAY()+2)
That will show Friday 15th Feb 2013 right now.....but on 15th feb it will change to showing 22nd Feb
For other days just change the +2 at the end, e.g. +3 will give you next Thursday, +4 will give you next Wednesday, +5 will give you next Tuesday etc.
This is some way you could do this though I am not sure if this is what you want.
=B1+FLOOR((TODAY()-B1)/7,1)*7
Basically, have a cell hold the start date of the stock inventory (first date in the past where you received this stock). You need to have also the number of days between restocking (here I hardcoded 7). Then you can just use the floor of the difference between today and that date divised by the restocking time. This will give you a step-function-style behaviour.

Resources