Skip to main content
Announcements
Qlik Connect 2025: 3 days of full immersion in data, analytics, and AI. May 13-15 | Orlando, FL: Learn More
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

creating date dimension for every 15 mins

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

9 Replies
PrashantSangle

Hi,

can you explain with sample data??

Regards,

Prashant Sangle

Great dreamer's dreams never fulfilled, they are always transcended.
Please appreciate our Qlik community members by giving Kudos for sharing their time for your query. If your query is answered, please mark the topic as resolved 🙂
rahulpawarb
Specialist III
Specialist III

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

Not applicable
Author

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

Not applicable
Author

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

jonathandienst
Partner - Champion III
Partner - Champion III

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.

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein
jonathandienst
Partner - Champion III
Partner - Champion III

If you are running 15 minute intervals since 2000, I recommend you split the time and date into 2 different fields.

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein
jonathandienst
Partner - Champion III
Partner - Champion III

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.

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein
tresesco
MVP
MVP

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();

Not applicable
Author

Hi Jonathan,

Please find the attached application and modified the code in calender.

Thanks

Thiru