Calculate case age in salesforce org - salesforce

How to calculate case age? Excluding weekends and Holidays?
if case is close calculate till close date or if case is open calculate till today.
it would be great if anyone will help me with step by step like i am new to this tech. thanks in advance
I tried using formula but could not do with that what should be the exact solution?

Sample formula exists in documentation: https://help.salesforce.com/s/articleView?id=000385836&type=1 but it does only Monday-Friday, no holidays.
There's also a link about feature activation that can help in reports: https://help.salesforce.com/s/articleView?id=000387290&type=1
A more proper thing would be to calculate it with apex, there's a built-in function for that assuming you configured the calendar and holidays in setup: https://stackoverflow.com/a/69723001/313628

Related

Datastudio: Blended Data: Date aggregation not working

I have a blended data source, that connects two filtered Google Analytics metrics. In there I have a calculated chart field, that gives me the ratio between these two filtered metrics. Now I'm trying to change the date aggregation to year-month, but there seems to be a problem.
This is with date auto, which is perfect:
However this is what happens with Year Month aggregation:
There should be only a line per month left, but somehow the aggregation is not working.
Do you have any idea on how to fix this? I've setup my blended data source at least 10 times trying to use the date on one source or as a key, but none worked.
Cheers
Andreas
I didn't find a fix either. Worked around it by making a custom field with the function MONTH(date) and using that. Works like a charm
Your solution did the job perfectly. Thank you, Joppe. I am quoting your workaround as an answer to bring more visibility to it.
Credit: Joppe De Cuyper (comment in the question)
Best solution here :
https://support.google.com/looker-studio/thread/96504295?hl=en
I have found others with a similar issue
https://support.google.com/datastudio/thread/65220021?hl=en
The workaround I guess is to maybe have dedicated column that represents date month in your source data. So 01-01-2021 for all Jan 2021, etc. As long as they are the same it should work I think.
WORKAROUND
You can use the following Formula and add a calculated field to your source table:
DATE(YEAR(your_date_column),MONTH(your_date_column),1)
Last edited Feb 3, 2021

how to get hourly calculation based on earliest pickup time and earliest stoptime

how to get the hourly calculation according to the earliest start time and earliest stop time.
the condition is if the driver has the same name of drop address. the hourly calculation will show for all. The 0.00hrs should apply to all riders with the same drop address regardless of how many in the same ride. I attached a screenshot and which type of output I needed it's shown in highlighted areas.
enter image description here
Use DATEDIFF function to calculate the number of minutes or seconds between start and end times and divide it by 60 or 3600 to get the hours.
Why using XPathSelectElements in c# try give me some example. and try to give me Xdocument all method what is the work and some example?
After creating date first approach Entity framework how to add table columns, a procedure from an existing database in ENTITY Fream work

Excel SUM IF with multiple array criteria

I am trying to do a "sum if" that checks whether the month and year are the same as the criteria on the income sheet column A as well verifying the income code in column D.
I have used the option with the * as the AND function.
I am using array formulae that work independently as I have shown below, but they fail when I try to get them to work together.
I cannot figure out how to calculate the desired result.
Income summary table
Income table
Please find working formulae as follows:
Check Month and Year"
=SUM(IF((MONTH(Income!$A$3:$A$10000)=MONTH($A3))*(YEAR(Income!$A$3:$A$10000)=YEAR($A3)),Income!$C$3:$C$10000))
Check Code
=SUMIF(Income!$D$3:$D$10000,"="&$C$2,Income!$C$3:$C$10000)
Please find non-working formulae as follows:
=SUM(IF((Income!$D$3:$D$10000*(MONTH(Income!$A$3:$A$10000)=MONTH($A3))*
_(YEAR(Income!$A$3:$A$10000)=YEAR($A3),"="&$C$2)),Income!$C$3:$C$10000))
I hope that somebody can help,
Thanks
Try this:
=SUM(IF((Income!$D$3:$D$10000=$C$2)*(MONTH(Income!$A$3:$A$10000)=MONTH($A3))*(YEAR(Income!$A$3:$A$10000)=YEAR($A3)),Income!$C$3:$C$10000,0))
You can also use this SUMPRODUCT variant:
=SUMPRODUCT(--(Income!$D$3:$D$10000=$C$2),--(MONTH(Income!$A$3:$A$10000)=MONTH($A3)),--(YEAR(Income!$A$3:$A$10000)=YEAR($A3)),Income!$C$3:$C$10000)

How to get last year's same week data in SOLR

How do I get last years same week data?
I used fq=trans_date:[NOW-1YEAR/DAY-7DAY TO NOW-1YEAR/DAY] on date field which will give me last 7 days data for last year. But that approach doesn't take into account calender weeks.
It's probably easier to calculate the boundaries for your week number last year in the frontend and then query Solr with the date interval. That way you can get the behavior you want regarding sundays/mondays as well.
Solr does not provide a nice way to do this.
It would be really cool if you could do fq=trans_date:[NOW-1YEAR/WEEK TO NOW-1YEAR/WEEK] but this is not supported.
Nevertheless, you could create a quick function using php or javascript using each language's native Date operators and get the Week number from today to produce start and end points to feed solr in a query like [1995-12-31T23:59:59.999Z TO 2007-03-06T00:00:00Z].

Crystal Reports- use other records for condition?

I am somewhat new to crystal reports and the syntax involved, and cannot seem to find the specifics by searching.
The problem is,
I need to check a condition of another record (linked as in image) for when Op No=10 in table Route, I must then check the Date Complete of this record in table WO Route Schedule for the same OP (see image for how they are linked) with a date input by user when the report is ran.
Table links
The jist is, im trying to show the font of a field in red when Date Complete>=FDate (user) (FOR OP 10), but since the actual list i am generating is of OPs that are not 10, I cannot seem to point crystal to look for when Op No=10, which is linked to the current OP by Route_ID and Work Order_ID! I have been trying many If statements, as well as using a case statement for when Op_No=10, but to no avail.
As a novice, I am not entirely sure of what other information is needed. Hopefully the images help explain my motive, but please ask for more info if you think this problem can be solved.
Regards
EDIT: More context if it helps (first comment)
Yeah it's hard to explain without overdoing the details, but each work order (WO) has around 100 operations (OPs). Now, crystal reports generates a list of OPs which are still active on the shop floor, but firstly it must check if a certain OP has been completed FOR THAT work order, which then produces a field with red font for when OP number 10 is completed. Now, if I was to simply put If {WO_Route_Schedule.Date_Complete}>={?FDate} , it would use the current OPs complete date, not OP No 10 for that Work order!
ok try below solution:
Place below condition in record selection formula .
{WO_Route_Schedule.Date_Complete}>={?FDate}
to find record selection formula go to File--> selectin formula ---> record
Place the op field OP No in detail section,
Now right click the op no field go to Format field ---> Tab Font ---> formula editor of color
write below condition there
if Op No=10
then crRed
else crBlack
Let me know how it goes

Resources