Add aging/dwelling time to a certain timestamp - date

Need a formula or function to add time aging to an certain timestamp. Need to convert a time into a 7 day aging period and add conditional formatting for highlighting aging timestamps
Example of what I have right now
Example of what final product should look like
Tried timevalue but couldn't figure out what or how to frame formula or even if it was the correct way to start it.your text

Related

How to get last day of previous month in DataStage?

I explored all the functions available in the transformer, but I couldn't find the exact function to get the last day of the previous month in standard format, i.e. dd/mm/yyyy. Please help me in this regard.
The field that needs to appear is in the COL_C field.
enter image description here
inside it I can't put anything that returns me this result
You can use DateOffsetByComponents to substract the current day.
Cut out the day part from your date and substract it with above function.
i.e. 16/12/2022 - 16 = 30/11/2022

Webi: How to use double slider input control with dates?

My boss asked me to add a double slider input control for the date information on a report on Webi.
We have several columns and two of them display a date (start and end date of procedure). So I need to have two double slider, one for each date.
I've been searching for a whole day now and I know that it is not directly possible to use double slider with dates, because double slider only works with values (measures) and dates don't have that.
But I managed to create two more variables on the business layer. I used the following SQL function:
CAST(currentDate as Bigint))
These variables are displaying the date as numbers (e.g. 1090101 for 01.01.2009 (format is "dd-MM-yyyy")).
And it is working great! But it displays the dates as number, which is not possible to use for work. No one will know which date is 1090101. I could perhaps let both columns (date as date and date as number) in the report, so people could check the date they want to filter with the input control and select the right number on the slider. This could be a workaround, but not a clean one, I think.
I tried to change the format of the date as number to a date format, but then I could not use the slider anymore (even if the variable is a number).
I looked for a way to change the formatting of the values displayed on the slider, but with no luck.
So I'm asking for your help. Does anyone know how I could make this work?
Is there really no solutions for such a useful way of filtering data? I mean, filtering data by an interval of dates is surely something people want to do quite often, I assume.
Thank you in advance for your time.
(Version Webi : SAP BusinessObjects BI Platform 4.2 Support Pack 8 Patch 6,
Version: 14.2.8.3671)
You could format your date value as year, month, day and then convert it to a number so the value you are filtering on makes a little more sense. Like this...
=ToNumber(FormatDate([Your Date];"yyyyMMdd"))
It will be better than just an arbitrary number, but certainly not perfect since you will have large chunks of your range for which there never will be any corresponding data (e.g. 20211232 through 20220100).
What is wrong with just a Minimum and Maximum input controls? They are more intuitive and simple to create. Sometimes what your user or boss asks for is a bad idea and/or just not possible.

How can I calculate my win rate on one column based on the date on another?

I created a rudimentary Google Form to track my win rate at Starcraft. The first column on the resulting Google Sheet is Timestamp created by the form.
I have another column that has my win-loss, and I am able to calculate my percentage for the entire sheet (all games). However, I want to be able to see my daily win rate, and I can't figure out the correct way to go about it.
I tried COUNTIF, COUNTIFS, with TODAY() and I was able to count the games for a certain day, but I don't know how to use it to tie in with my win-loss column. What I currently do is adjust my Daily formula to specify today's date before playing. I was hoping I won't need to do this.
Please see Win-Loss Stats Sheet
Solution:
You can extend your formula to compare against the date in column A:
=(COUNTIFS(D2:D, "Win", ARRAYFORMULA(INT(A2:A)),TODAY())/((COUNTIFS(D2:D, "Win",ARRAYFORMULA(INT(A2:A)),TODAY()))+(COUNTIFS(D2:D, "Loss",ARRAYFORMULA(INT(A2:A)),TODAY()))))
The additional condition would be ARRAYFORMULA(INT(A2:A)),TODAY(), which converts the timestamps into dates and compares them to today's date.
Sample Output:

Tableau: time series chart displaying last day of month instead of first

In any time series chart, it looks like Tableau defaults to the first day of the month on the tick marks.
Is there a way for Tableau to show the last day of the month instead?
You can sort of force it by going into "Edit Axis", starting it on a month end, and 1 as the monthly interval. However, this is not a dynamic process and would require that I update this every time I had new data.
Anyone have any ideas? Thank you!
If in your data series you want each data point to represent the whole month, and you just want to label it with the last date of that month, then this workaround might work:
use calculated field to coerce all dates in the month to the last date of that month: DATEADD('day',-1,DATEADD('month',1,DATETRUNC('month',[Order Date])))
use this field as date in your time series
use 'More -> Custom -> Month / Day /Year' as display option for this field

Creating Bins in Tableau for Days in a Week

Could someone please explain me creating BINS based on Weekdays in Tableau? I tried creating different Calculation Fields but it won't work
You're working too hard.
Tableau already knows how to bin values by dates at many levels of granualarity: such as year, month, day, weekday, hour etc. So you don't need to create a new field to bin dates by the day of the week. (creating bins is not difficult, it's just already available in this case)
Just put a discrete (blue) date or datetime field on a shelf. You'll see the date level of granularity displayed like, say, YEAR(MyDateField) with a leading plus sign.
You can either
click on the plus sign to drill down by adding a second level, say MONTH(MyDateField)
or
right click on the field to select the date level of granularity you want
Alex's Answer is exactly correct, Tableau will perform the operation automatically. What is great about is that you can select various formats (Full day name, number, 1 letter or 3 letter day etc.).
However if you absolutely need to you can used this formula:
datepart('weekday',[Date])
to give you the 1 (Sunday) to 7 (Saturday) value if you need it for something other reason, say another calculation.