Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi
I have scenario
I need to create date dimension which will populate records for every 15 mins.
Please suggest me the code
Regards
Thiru
Hi,
can you explain with sample data??
Regards,
Prashant Sangle
Hello Thiru,
Sorry to say but your query sounds ambiguous to me. Do you mean to say, you need a script to product a Time dimension table with an attribute with 15 mins level values or a script to implement incremental load?
Could you please shed more light on it? This will help us to provide you expected response.
Regards!
Rahul
Hi Rahul,
Yes you are right.
I need to create date dimension with 15 minutes interval
i.e 2000-01-01 00:00
2000-01-01 00:15
2000-01-01 00:30
2000-01-01 00:45
2000-01-01 00:60
.....
2017-03-06 24:00
Like that.
Regards
Thiru
Hi Prashant,
I need to create date dimension with 15 minutes interval
i.e 2000-01-01 00:00
2000-01-01 00:15
2000-01-01 00:30
2000-01-01 00:45
2000-01-01 00:60
.....
2017-03-06 24:00
Like that.Is this fine or can i attach sample application which is currently day wise
Regards
Thiru
This will round the time to the nearest 15 minutes
=Time(Round(TimeField, 15/24/60))
You should explain your requirements in more detail for more specific help.
If you are running 15 minute intervals since 2000, I recommend you split the time and date into 2 different fields.
Generate the dates and times like this
Let vMaxDate = ...;
Let vMinDate = ...;
Let vPer = 15/ (24 * 60);
Cal:
Load
Time(Frac((RowNo() - 1) * $(vPer))) as Time
Date(Floor((RowNo() - 1) * $(vPer)) as Date
AutoGenerate Ceil(('$(vMaxDate)' - '$(vMinDate)') / $(vPer));
You will need to set the values of vMinDate and vMaxDate per your requirements.
Try like:
let vStartDate=Num(MakeDate(2000,1,1));
Load
Timestamp($(vStartDate)+(1/24/60*15)*(IterNo()-1))as DateTime
AutoGenerate 1 while $(vStartDate)+(1/24/60*15)*(IterNo()-1) <=Today();
Hi Jonathan,
Please find the attached application and modified the code in calender.
Thanks
Thiru