cancel
Showing results for 
Search instead for 
Did you mean: 

Online Store with updated Dates - my gift to you!

RADSr
Captain
Captain

Hello Incorta folks  (  Incortites Incortiacs?  Home Incorting King/Queens?  Surely not Incoherents!  ), 

I was on a webinar for another vendor and one of the things which caught my eye was the fact that their demo data was dated up to 2024.

"Hey," I thought to myself, "my demo data isn't dated up to 2024 and it's always kind of bugged me." 

Then I thought why not fix it?   So I did.  

The attached Online Store schema export should contain tables with dates updated to reflect the current calendar.  Logic at the end of this post.

Turns out the time dimension only runs through 2024 so that should get updated before Jan 25, but my energy was waning and more important tasks were calling.  Do feel free.

If you've read this far here's an interesting nugget!   I had originally created an MV for the address table named "AddressMeAsCaptain" because I have an odd sense of humor.   

That's not the interesting part.  I deleted that MV.   I've saved a bunch of times since then.   

But if you dig though the export there it is under the notebook folder complete with the date update logic ** and the result set for the MV ** which is terribly interesting to me.   I'd have assumed the result set would have been stored in a parquet file and not read when zipping the export.   "Hmmmmm" as they say, "interesting."

In any case, here it is.   If you fix my mistakes and/or extend it pls post a reply w/ an updated export and we'll all pay it forward to new Incorta folks...    

======Applied wherever there is a date field ==========

select
CountryRegionCode
, CountryRegionName

, date_add(modifieddate, ModifiedDateDaysUntil ) ModifiedDate

from OnlineStore.countryregion
JOIN

(select max(modifieddate) MaxOriginalModifiedDate
, datediff(current_date, max(modifieddate)) as ModifiedDateDaysUntil
from OnlineStore.address ) mxdt

ON 1 = 1

===========999================

-- IncortaOne@PMsquare.com --
1 REPLY 1

JoeM
Community Manager
Community Manager

A few things to hit on here!

First off, check out that new label under your username!

The general leaning is "Incortans", but I certainly don't mind "Incortiacs" 😉

I can confirm I see the notebook in the .zip but not in the schema. Perhaps this is too many versions back, but were you running a print statement within the notebook? I'd have to check, but an educated bet would be that paragraph results are saved. Even without an export, re-opening a notebook will show results from a previous run. I do see a line saying the results were truncated to '1000 rows', so it seems like that might be the case.