How to capture current time on value list field change as in set date to current date - archer

How to capture current time for value list field change as in set date to current date.Need to capture curtent time with current date when value list field change value. Incident close time with current date.

Based on your question, it seems obvious that the field 'Incident Close Time' is a calculated one.
The calculation would be:
IF(
AND(
[Incident Status] = VALUEOF([Incident Status],"Closed"),
ISEMPTY([Incident Close Date])
),
NOW(),
[Incident Close Date]
)
Two things to take care here:
Firstly, if the Incident Status is a calculated field, make sure the status field is above the time field in the calculation order.
Secondly, if you want to capture the time as well, make sure the field 'Incident Close Date' field is set to capture 'Date and Time' in the options tab of the field configuration. You can do this by checking off the calculation, selecting the 'Date and Time' option and checking on the calculation again.

Related

How to have different calculations in the same column?

I have Users on my platform and each user has a different status attached to them. What I want to achieve is that based on the Users status I want a specific calculation to be done and displayed in the same column. Based on each Users status, the calculation involves 3 dates: Last Review Date, Actual End Date and Today's Date (I will be using the GETUTCDATE() function for this but for the purpose of this post I have added a date into this column).
Below we have the 6 different Statuses and the calculations that go with each:
Draft - If the user is in this status there is no calculation and the value in the column should be NULL
Active - If the user is in this status the calculation should be: the amount of days it has been from todays date and their Last Review Date.
Completed - If the user is in this status there is no calculation and the value in the column should be NULL
Withdrawn - If the user is in this status there is no calculation and the value in the column should be NULL
Temporarily Withdrawn - If the user is in this status the calculation should be: the amount of days it has been from todays date and their Actual End Date.
Archived - If the user is in this status there is no calculation and the value in the column should be NULL
See link to image for what the table looks like Table.
I am using Microsoft SQL Server Management Studio 18.
Consider using CASE on the display part. Something like:
SELECT
(...)
,CASE
WHEN status = 'Active' THEN <calculation for status Active>
WHEN status = 'Temporarily Withdrawn' THEN <calculation for status Temporarily Withdrawn>
ELSE NULL
END AS calculation
,(...)
FROM (...)

I need to convert total date to month only

I set up a google forms form for my work where my employees pass information and this information is recorded in a spreadsheet. The information, when recorded, automatically inserts a date and time in the first column of form responses. However, when I enter the code = month (a1), it always returns the answer "1" or "January" and this information does not match the date entered in the column. How do I fix this?
If you are entering '=month(a1)' for every row, then you are always taking the month of the top left cell in the sheet. You would need to adjust the row number for the row you are in.
You could use something like '=month(now())' to ensure you are always getting the month of the current date.

Display all dates even if there is no data

I am attempting to display all the dates within a range even if they do not have data for the particular date.
Our employees do work 24/7 365 ( like everyone else) so there are dates within my time range that wont pop up. What i have tried is to add and exception that states even if the date has a null to display that particular date.
Currently i have a crosstab with the row being the numbers of items completed and the columns being the date that the item was completed.
For a visual:
04/01/19 04/02/19 04/03/19
1 2 3
I would like to continue that till the end of my range (the month) but my data skips if nothing was completed for that date.
What i currently have:
04/01/19 04/04/19 04/05/19
1 6 8
For the rows I have this in the formula bar for my row.
If [Items Completed]> 0 Then [Items Completed)] Else 0
For the columns I have this in my formula bar
If IsNull([Completed Date]) then 0 Else [Completed Date]
Thinking this would give me a 0 in those columns where nothing was done.
You need to create a variable and use the TimeDim function like this...
All Dates = TimeDim([Completed Date])
Then replace [Completed Date] in your table with the [All Dates] variable. You can name it whatever you want. This will result in blank values for the dates for which you do not have data. If you want to have zeroes display for the dates with no data you can apply a custom format setting "Undefined" to "0".
You can find a more thorough explanation with possible variations here.
Enjoy!
The TimeDim method was the basis for me achieving what I needed - namely a line chart that displayed zero values if no one had completed a training course on a particular date in my range. I work in Learning Management System software so this is often required.
The object in my case is called [Course Completed Date (Success)], so here's my variable (which is a dimension, not a measure):
=TimeDim([Course Completed Date (Success)])
Note in my screenshot how the zeros and now displayed. Previously they were missing.

Creating a DAX pattern that counts days between a date field and a month value on a chart's x-axis

I am struggling with a DAX pattern to allow me to plot an average duration value on a chart.
Here is the problem: My dataset has a field called dtOpened which is a date value describing when something started, and I want to be able to calculate the duration in days since that date.
I then want to be able to create an average duration since that date over a time period.
It is very easy to do when thinking about the value as it is now, but I want to be able to show a chart that describes what that average value would have been over various time periods on the x-axis (month/quarter/year).
The problem that I am facing is that if I create a calculated column to find the current age (NOW() - [dtOpened]), then it always uses the NOW() function - which is no use for historic time spans. Maybe I need a Measure for this, rather than a calculated column, but I cannot work out how to do it.
I have thought about using LASTDATE (rather than NOW) to work out what the last date would be in the filter context of any single month/quarter/year, but if the current month is only half way through, then it would probably need to consider today's date as the value from which to subtract the dtOpened value.
I would appreciate any help or pointers that you can give me!
It looks like you have a table (let's call it Cases) storing your cases with one record per case with fields like the following:
casename, dtOpened, OpenClosedFlag
You should create a date table with on record per day spanning your date range. The date table will have a month ending date field identifying the last day of the month (same for quarter & year). But this will be a disconnected date table. Don't create a relationship between the Date on the Date table and your case open date.
Then use iterative averagex to average the date differences.
Average Duration (days) :=
CALCULATE (
AVERAGEX ( Cases, MAX ( DateTable[Month Ending] ) - Cases[dtopened] ),
FILTER ( Cases, Cases[OpenClosedFlag] = "Open" ),
FILTER ( Cases, Cases[dtopened] <= MAX ( DateTable[Month Ending] ) )
)
Once you plot the measure against your Month you should see the average values represented correctly. You can do something similar for quarter & year.
You're a genius, Rory; Thanks.
In my example, I had a dtClosed field rather than an Opened/Closed flag, so there was one extra piece of filtering to do to test if the Case was closed at that point in time. So my measure ended up looking like this:
Average Duration:=CALCULATE(
AVERAGEX(CasesOnly, MAX(DT[LastDateM]) - CasesOnly[Owner Opened dtOnly]),
FILTER(CasesOnly, OR(ISBLANK(CasesOnly[Owner Resolution dtOnly]),
CasesOnly[Owner Resolution dtOnly] > MAX(DT[LastDateM]))),
FILTER(CasesOnly, CasesOnly[Owner Opened dtOnly] <= MAX(DT[LastDateM]))
)
And to get the chart, I plotted the DT[Date] field on the x-axis.
Thanks very much again.

Date is not refreshing based on the Combo value in SSRS

I have a SSRS report with following fields:
1. Season.
2. Start Date
3. End Date
Whenever season changes, the default date for start-date and end-date needs to be changed. I created a dataset which populate start-date and end-date values based on the season input and assigned the values to Startdate and enddate parameters. In Report, when season selected for first time default-date has changed correctly. But when I change the Season to another value, default-date are not refreshing. What is the problem here?
I have attached the screenshots below. Could someone help me on this?
First Screen-shot shows the default dates for Season 1 (Tax season)
Second Screen-shot shows the default dates for Season 2 (Pre-season) (After Changing Season-1 to Season-2 default date values are not changing )
I found out this issue occurs because the call to data-set is not happened in the second refresh.
Thanks for the help
Your dataset for the dates has to include
SELECT start-date, end-date FROM Table
WHERE Season = #Season
then Default the values for the date parameters to select from the dataset and it will change them when ever you change the season.