Hi everyone - I'm hoping someone can help me with ...
# suiteanalytics
n
Hi everyone - I'm hoping someone can help me with a formula. I want to group Time Entries by dates - Group 1 = dates 1-15, Group 2 = 16-31, but I'm not sure how I would isolate those records in a Case statement - any assistance is greatly appreciated.
g
CASE WHEN TO_CHAR({datefield},'DD')<=15 THEN '1-15' ELSE '16-31' END
replace datefield with your specific field.
n
Ty @Gregory Jones - the formula I currently have (which is not working) is: Case when {type} = 'Planned Time' AND TO_CHAR({datefield},'DD')>=16 THEN {durationdecimal} end Ultimately, I want to group & sum by Customer the Planned Time from dates 16-13, while tracking actual time for dates 1-15. Any advice you can offer on correcting the formula, I'm open to your input.
g
Do you want {durationdecimal} in separate columns for each grouped customer based on if it's 16-31 (Planned) or 1-15 (Actual)?
Also, what's 'not working' about your formula?
n
@Gregory Jones Yes - ideally i am grouping Actual time from 1-15 in a single column & Planned Time from 16-31 in another column
g
Ok are you using {trandate} in your actual formula?
you have {datefield}, which I was just using as a reference (it's not an actual field)
n
@Gregory Jones 😅 thats embarrassing! I updated the formula and it is working as expected now
g
Bingo!
n
Thank you for the assist!
g
No worries
Glad it worked out! Should be able to just duplicate/update that case statement to get that actual time column, then you're good to go!
n
@Gregory Jones do you think its possible to modify the criteria to be dynamic - column 1 [actual time entries this month through {today}], column 2 [allocated time entries {tomorrow} through end of month]?
g
Wouldn't see why not. Take a look at some of the formulas on this page http://www.melioza.com/2015/09/netsuite-report-dates.html
Specifically, "Month To Date" for your column 1 and "Last Day of This Month" for your column 2. I might have some time later today to see about specific formulas for your needs.
n
this is great - thank you
g
I've used the formulas on that site quite a lot. I think the "Month To Date" one would only require you to modify what is spits out if it's true.
You'll have to combine the Last Day of This Month with other criteria...probably like CASE WHEN {trandate} BETWEEN {today}+1 AND LAST_DAY(TRUNC({today}, 'MONTH'))
n
@Gregory Jones works as expected - thank you again!
g
Sure thing!