Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

how to create master calender link with bi-hourly time

I have a date time field with bi-hourly time, i would like to know how to create master calender and link it to bi-hourly time. Here is my data

Datecpu-0cpu-1cpu-2cpu-3
10/1/2014 1:001.22E+011.19E+010.00E+000.00E+00
10/1/2014 3:001.04E+011.03E+010.00E+000.00E+00
10/1/2014 5:001.68E+011.64E+010.00E+000.00E+00
10/1/2014 7:002.33E+012.30E+010.00E+000.00E+00
10/1/2014 9:002.45E+012.42E+010.00E+000.00E+00
10/1/2014 11:002.59E+012.60E+010.00E+000.00E+00
10/1/2014 13:002.66E+012.66E+010.00E+000.00E+00
10/1/2014 15:002.76E+012.79E+010.00E+000.00E+00
10/1/2014 17:002.69E+012.72E+010.00E+000.00E+00
10/1/2014 19:002.55E+012.54E+010.00E+000.00E+00
10/1/2014 21:002.30E+012.30E+010.00E+000.00E+00
10/1/2014 23:001.61E+011.59E+010.00E+000.00E+00
10/2/2014 1:001.04E+011.06E+010.00E+000.00E+00
10/2/2014 3:009.18E+009.34E+000.00E+000.00E+00
8 Replies
its_anandrjs

Please explain about the bi-hourly time it is not understood.

Not applicable
Author

Sorry about that. If you see the data, the granularity is two hr. I want to create a calender only for existing hours. In this case 1, 3, 5, 7, ...., 23.

jolivares
Specialist
Specialist

Separate your date field, that is, create a field date and another date_hour, the create a calendar with a date field to link with your table.

Is preferable that the hour is a field too in order you can filter over it.

MarcoWedel

Hi,

one possible solution:

QlikCommunity_Thread_139502_Pic1_.JPG.jpg

QlikCommunity_Thread_139502_Pic2_.JPG.jpg

tabCalendar:

LOAD *,

    Hour(Date) as Hour,

    Day(Date) as Day,

    WeekDay(Date) as WeekDay,

    Week(Date) as Week,

    WeekName(Date) as WeekName,

    Month(Date) as Month,

    MonthName(Date) as MonthName,

    Ceil(Month(Date)/3) as Quarter,

    QuarterName(Date) as QuarterName,

    Year(Date) as Year,

    WeekYear(Date) as WeekYear;  

LOAD Date(AddYears(MinDate+(IterNo()-1)/12,-10),'MM/DD/YYYY hh:mm') as Date

While AddYears(MinDate+(IterNo()-1)/12,-10)<=Now();

LOAD Min(Date#(Date, 'MM/D/YYYY hh:mm')) as MinDate

FROM [http://community.qlik.com/thread/139502] (html, codepage is 1252, embedded labels, table is @1);

hope this helps

regards

Marco

Not applicable
Author

i have divided date and time. created master calender and created a time field. But date and time does not synchronize. Here is my model and would you mind forward me a sample of master calender and time dimension. tx. model.PNG.png

MarcoWedel

You asked here:Time as a Dimension

This is my thread how to create master calender link with bi-hourly time

you have provided a solution, but since i have to join 3 tables and each table has timestamp filed. I am able to create master calender but the issue time. Here is my list box from date and time. I would like to know why  iam not getting unique time .

date-time.PNG.png

I suppose you created the Time listbox with an expression like

Time(Date)

You then will get multiple entries because this expression does not change the underlying numerical value.

One solution would then be:

Time(Frac(Date))

hope this helps also

regards

Marco

Not applicable
Author

since i have multiple timestamp fields from six different tables, how do i join these fields?. Yes if i have one timestamp column then your suggestion would work. But i have 6 various timestamp fields and looking for a solution.