Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
My data consist of a date field and other fields with values.
I want to add a column and flag the dates in chunks of 30 days in this column. Like chunk 1 for the first 30 days, chunk 2 etc.
A day or more may be missed in the date field so that I can't just count rows. Another thing is that dates have multiple entries for the same date.
I want to do that in the Skript, because other calculation will follow and I need them in the Skript.
It's my first post here I hope I did ok (?).
Psuedo-coding this, you'll want to do something like:
Load Minimum(Date) as MinDate from YourTable; // Easy to find threads about getting the min value from a field
Let vMinDate = Peek(MinDate); // And putting it into a variable
Load Date, Floor((Date - vMinDate) / 30)+1 as ChunkNumber
From YourTable;
@0ctopus Do you want to exclude missing days from Chunk? For example from 01-Jan-2024 to 27-Jan-2024 you have data but 28-Jan, 29-Jan is missing, till here we have 27 days in chunk1, so do you want 30-Jan-2024 to continue chunk from 28th day or still should be count as 30th day?
It seems I just lost my answer... So again:
I want chunks of a 30 days range, they could be just a few values in this time lapse.
@0ctopus Not sure I understood. May be few example with dates will be needed
Psuedo-coding this, you'll want to do something like:
Load Minimum(Date) as MinDate from YourTable; // Easy to find threads about getting the min value from a field
Let vMinDate = Peek(MinDate); // And putting it into a variable
Load Date, Floor((Date - vMinDate) / 30)+1 as ChunkNumber
From YourTable;