not sure what I am missing in this case when state...
# suiteanalytics
s
not sure what I am missing in this case when statement, I tried Tomorrow that didin't work, that's why I have today+1 CASE WHEN {expectedreceiptdate} BETWEEN {today} AND ({today}+6) THEN '<a href=https://.app.netsuite.com/app/common/search/searchresults.nl?searchid=3421&amp;whence=>PO Delivering this week</a>' WHEN( {expectedreceiptdate}=({today}+1) then '<a href=https://.app.netsuite.com/app/common/search/searchresults.nl?searchid=3420&amp;whence=> PO delivering Tomorrow</a>' WHEN (ROUND({expectedreceiptdate}-{today})) = 0 THEN '<a href=https://.app.netsuite.com/app/common/search/searchresults.nl?searchid=3232&amp;whence=>Delivering Today </a>' else END
b
it would be a lot easier to reason with your formula if you just did your comparisons against one statement
like make all your comparisons against
{expectedreceiptdate} - {today}
currently you have a bunch of statements that are probably equivalent in different way
s
one of the line does show up so first statement is correct, and the result shows up, second and third is the one that is giving me the issue
b
my guess would be that the second guess is never true, its too specific
and the third case is hidden because the first case covers it
{expectedreceiptdate} - {today}
should give you the difference in days
s
hmm, yes you are right but first case is Total for this whole rolling week, second statement is getting the list of things coming in tomorrow and third statement covers things coming in today
b
you need to understand that there are lots of different dates that correspond to tomorrow
s
hmm yeah that's why i said Today+1
b
your second statement is checking if your expected ship date is one specific dcate
2021-04-01T19:15:28.207Z
represents tomorrow right now (+1)
in a couple of seconds
2021-04-01T19:16:20.675Z
i can basically guarantee your expected ship date is neither of those 2 dates
the precision of {today} is much more than you think it is
s
hmm then how do you get list of POs delivering today or tomorrow? I thought Today and today+1 would do it, but I guess not
b
i will once again recommend that you start with
{expectedreceiptdate} - {today}
, which is a nice number that represents the difference in days
you can have a case for when its smaller than 1 (basically today)
smaller than 2, (tomorrow)
s
ok thanks, let me try that
b
or smaller than 7 (next week)
there are nuances like most people wouldnt call a date 23 hours in the future today, but you didn't really make that distinction in your formula anyways