Camunda accamulate history data with removal_time < now() - camunda

My camunda application accamualated history data with removal_time < now().
There are raws with removal_time from a year ago.
In act_hi_job_log with job_def_type = 'history-cleanup' from 1 to 400 per days.
My settings:
HistoryRemovalTimeStrategy - HISTORY_REMOVAL_TIME_STRATEGY_END
HistoryCleanupBatchSize - 500
HistoryCleanupStrategy - HISTORY_CLEANUP_STRATEGY_REMOVAL_TIME_BASED;
clean windows - 1 hour on working day, 4 hour on weekend days
How to icrease number of removal raws per day?

Related

How to get a percentage of grouped values over a period of time (at the hour scale) in DAX?

I have a dataset containing the duration (in minutes) of occupancy events over a period of 1 hour in my rooms:
# room date duration
--- ---- ------------------- --------
0 A1 2022-01-01 08:00:00 30
1 A1 2022-01-01 10:00:00 5
2 A1 2022-01-01 16:00:00 30
3 A1 2022-01-02 10:00:00 60
4 A1 2022-01-02 16:00:00 60
...
My date column is linked to a date table in which I have:
# datetime year month monthName day dayOfWeek dayName hour
--- ------------------- ---- ----- --------- --- --------- -------- ----
...
k 2022-01-01 08:00:00 2022 1 January 1 5 Saturday 8
k+1 2022-01-01 09:00:00 2022 1 January 1 5 Saturday 9
...
n 2022-03-01 22:00:00 2022 3 March 1 1 Tuesday 22
I am trying to retrieve the following percentage: duration/timeperiod through a measure. The idea behind using a measure is :
Being able to use a time slicer and see my percentage being updated
Using, for example, a bar chart with my date hierarchy, and being able to see a percentage in my different level of hierarchy (datetime -> year -> month -> dayOfWeek -> hour)
Attempt
My idea was to create a first measure that would return the number of minutes between the first and the last date currently chosen. Here is what I came up with:
Diff minutes = DATEDIFF(
FIRSTDATE( 'date'[date] ),
LASTDATE( 'date'[date] ),
MINUTE
)
The idea was then to create a second measure that would divide the SUM of the durations by the Diff minutes' measure:
My rate = DIVIDE(
SUM( 'table'[duration] ),
[Diff minutes]
)
I currently face a few issues:
The slicer is set to (2022-01-02 --> 2022-01-03) and if I check in a matrix, I have datetime between 2022-01-02 0:00:00 and 2022-01-03 23:00:00, but my measure returns 1440 which is the number of minutes in a day but not in my selected time period
The percentage is also wrong unfortunately. Let's take the example that I highlighted in the capture. There are 2 values for the 10h slot, 5min and 60min. But the percentage shows 4.51% instead of 54.2%. It actually is the result of 65/1440, 1440 being the total of minutes for my whole time period, not my 10h slot.
Examples
1- Let's say I have a slicer over a period of 2 days (2022-01-01 --> 2022-01-02) and my dataset is the one provided before:
I would have a total duration of 185 minutes (30+5+30+60+60)
My time period would be 2 days = 48h = 2880 minutes
The displayed ratio would be: 6.4% (185/2880)
2- With the same slicer, a matrix with hours and percentage would give me:
hour rate
---- -----
0 0.0%
1 0.0%
...
8 25.0% <--- 30 minutes on the 1st of January and 0 minutes on the 2nd
9 0.0% <--- (5+0)/120
10 54.2% <--- (5+60)/120
...
16 75.0% <--- (30+60)/120
Constraints
The example I provided only has 1 room. In practice, there are n rooms and I would like my measure to return the percentage as the mean of all my rooms.
Would it be possible ? Have I chosen the right method ?
The DateDiff function you have created should work, I have tested it on a report and when I select some dates, it gives me the difference between the first and last selected dates.
Make sure your slicer is interacting with the measure.
In the meantime, I think I found a simpler and easier way to do it.
First, I added a new column to my date table, that seems dubious but is actually helpful:
minutes = 60
This allows me to get rid of the DATEDIFF function. My rate measure now looks like this:
My rate = DIVIDE(
SUM( table[duration] ),
[Number of minutes],
0
)
Here, I use the measure Number of minutes which is simply a SUM of the values in the minutes column. In order to provide accurate results when I have multiple rooms selected, I multiplied the number of minutes by the number of rooms:
Number of minutes = COUNTROWS( rooms ) * SUM( 'date'[minutes] )
This now works perfectly with my date hierarchy!

Tableau - need to compare the number of records that came in last 7 days to the number of records that came in the last 7 days -1

In Tableau I have a db containing records with a create date [create date]
I need to compare the number of records that came in last 7 days to the number of records that came in the last 7 days -1 .
And show the change as a percentage.
Thanks
Assuming today is August 31th, last 7 days should be Aug 24-30, excluding today.
sum(if DATEDIFF('day',[Order Date],DATE(TODAY()-1)) <= 6 then 1 end )
If "7 days -1" means last 7 days starting from one day prior to yesterday, this second range is Aug 23-29.
sum(if DATEDIFF('day',[Order Date],DATE(TODAY()-2)) <= 6 then 1 end )
According to your different needs, you can just use this formula [(A/B)-1] in order to get the change in %:
(
sum(if DATEDIFF('day',[Order Date],DATE(TODAY()-1)) <= 6 then 1 end )
/
sum(if DATEDIFF('day',[Order Date],DATE(TODAY()-2)) <= 6 then 1 end )
)
-1

Showing results between 5 to 14 days

I am coding some customer service scripts and the aim is to show the results from 5 - 14 days after the deadline/date.
For example: date= 2016-01-20.
So five days after would be 01-25 and 14 would be 02.03 and the results should display it inbetween 5 to 14 days.
I have made an if statement:
if (date>= date.addDay(5) && date<= date.addDay(14))
{
print("Ticket ID: " + se.getField(0) + "\n" + "Ticket date: " + se.getField(1) + "\n\n");
}
functions addDay - adds a days to the date.
getField - gets fields ID and deadline/date.
In the results of this script I get also results from 2015. So there is something wrong with the logic of if-statement.
How should How to make it display results between 5 days after deadline to 14 days after deadline.

Coldfusion 10 scheduled task cron time for every 15 minutes but only on Tuesdays

Trying to setup a scheduled task in CF10 (Standard) to run every 15 minutes but only on Tuesdays. A cron created said this would do the job:
*/15 * * * 2
But that gives the error "An error occured scheduling the task.
Unexpected end of expression." I also tried
15 * * * 2
The notes say 6 or 7 space separated fields - what am I missing? Minute, hour, day of month, month, day of week is 5 fields.
The representation is in the below format:-
Seconds Minutes Hours Day-of-Month Month Day-of-Week Year (optional
field)
So, for a task to run every 15 minutes but only on Tuesdays, below is the CRON.
"0 0/15 * ? * TUE".
You can refer to the link below for more details:
http://www.quartz-scheduler.org/documentation/quartz-2.x/tutorials/tutorial-lesson-06

django date filter time past

Is there a nice filter I can use in Django template to allow me to turn a datetime into time period ago from now.
e.g.
{{ mydate | date_ago }}
that would display things like
12 seconds ago
2 hours ago
yesterday
4 days ago
2 weeks ago
12 jan 2001
where by after some distance it just displays the normal date.
timesince