Skip to main content
Announcements
See why Qlik is a Leader in the 2024 Gartner® Magic Quadrant™ for Analytics & BI Platforms. Download Now
cancel
Showing results for 
Search instead for 
Did you mean: 
markus19-85
Partner - Contributor III
Partner - Contributor III

time slices (trend diagram)

Hello,

I have the following table:

it only Shows the time slices of each state.

I would like to create a trend diagram, to the the whole process of an Issue. From the first Valid_from till today

to get the right solution I need every single date out of the time slice till today

For example like this

It is possible to solve this Problem in QlikView script? That would be greate

Thank you.

1 Solution

Accepted Solutions
sunny_talwar

Left Join IntervalMatch table to Table like this:

Table:

LOAD Issue_ID,

    Valid_from,

    Valid_until,

    State

FROM

[test (2).xlsx]

(ooxml, embedded labels, table is Tabelle2);

MinMax:

LOAD Min(Valid_from) as minDate,

  Today() as maxDate

Resident Table;

Let varMinDate = Num(Peek('minDate', 0, 'Temp')); 

Let varMaxDate = Num(Peek('maxDate', 0, 'Temp')); 

DROP Table MinMax; 

 

Calendar: 

LOAD Date($(varMinDate) + IterNo() - 1) as Date 

AutoGenerate 1

While $(varMinDate) + IterNo() -1 <= $(varMaxDate);

Left Join (Table)

IntervalMatch(Date)

LOAD Valid_from,

  Valid_until

Resident Table;

View solution in original post

5 Replies
sunny_talwar

I think you need to create a master calendar using the min date from Valid_from field and max date from valid_to field and then use interval match function to achieve what you are looking for.  About IntervalMatch you can see the following blog: IntervalMatch

HTH

Best,

Sunny

maxgro
MVP
MVP

you can find some help in this post and doc (technical brief at the end of the post)

How to populate a sparsely populated field

sunny_talwar

Try this script:

Table:

LOAD Issue_ID,

    Valid_from,

    Valid_until,

    State

FROM

[test (2).xlsx]

(ooxml, embedded labels, table is Tabelle2);

MinMax:

LOAD Min(Valid_from) as minDate,

  Today() as maxDate

Resident Table;

Let varMinDate = Num(Peek('minDate', 0, 'Temp')); 

Let varMaxDate = Num(Peek('maxDate', 0, 'Temp')); 

DROP Table MinMax; 

 

Calendar: 

LOAD Date($(varMinDate) + IterNo() - 1) as Date 

AutoGenerate 1

While $(varMinDate) + IterNo() -1 <= $(varMaxDate);

IntervalMatch:

IntervalMatch(Date)

LOAD Valid_from,

  Valid_until

Resident Table;

Ouput:

Capture.PNG

markus19-85
Partner - Contributor III
Partner - Contributor III
Author

thank you, thats looks good.

Is there a way to get ride of the syntatic keys?

sunny_talwar

Left Join IntervalMatch table to Table like this:

Table:

LOAD Issue_ID,

    Valid_from,

    Valid_until,

    State

FROM

[test (2).xlsx]

(ooxml, embedded labels, table is Tabelle2);

MinMax:

LOAD Min(Valid_from) as minDate,

  Today() as maxDate

Resident Table;

Let varMinDate = Num(Peek('minDate', 0, 'Temp')); 

Let varMaxDate = Num(Peek('maxDate', 0, 'Temp')); 

DROP Table MinMax; 

 

Calendar: 

LOAD Date($(varMinDate) + IterNo() - 1) as Date 

AutoGenerate 1

While $(varMinDate) + IterNo() -1 <= $(varMaxDate);

Left Join (Table)

IntervalMatch(Date)

LOAD Valid_from,

  Valid_until

Resident Table;