Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Creating graphic based on data with valid during time intervals

Hello,

I've got a set of data which represent values which are valid over a certain time interval. I've created a sample and attached it to this post.

So the data are:

- Product

- Valid from

-Valid until

- Value

I'd like to create, based upon these data, a graphic which shows the values as a step-function on a time basis. So the line stays horizontal until the date "valid until" and then jumps (steps) towards the next value (same product, value according to the date mentioned in the corresponding "valid from"). Multiple products should be included in the graph at the same time.

Thanks in advance for the advice !

1 Solution

Accepted Solutions
swuehl
MVP
MVP

You could use IntervalMatch for linking you slowly changing dimension to a calendar, like:

Product:

LOAD Product,

     [Valid from],

     [Valid to],

     Value

FROM

C:\Users\Stefan\Downloads\Sample_intervalgraph.xls

(biff, embedded labels, table is Sheet1$);

Calendar:

LOAD

Date(makedate(2010)+RecNo()-1) as Date

autogenerate 365;

IntervalMatch (Date) Load [Valid from], [Valid to] resident Product;

Then just create a line chart with dimension Date and Product and as expression

sum(Value)

See also attached.

An alternative is to create additional data records right in your product table using while statement.

Stefan

View solution in original post

1 Reply
swuehl
MVP
MVP

You could use IntervalMatch for linking you slowly changing dimension to a calendar, like:

Product:

LOAD Product,

     [Valid from],

     [Valid to],

     Value

FROM

C:\Users\Stefan\Downloads\Sample_intervalgraph.xls

(biff, embedded labels, table is Sheet1$);

Calendar:

LOAD

Date(makedate(2010)+RecNo()-1) as Date

autogenerate 365;

IntervalMatch (Date) Load [Valid from], [Valid to] resident Product;

Then just create a line chart with dimension Date and Product and as expression

sum(Value)

See also attached.

An alternative is to create additional data records right in your product table using while statement.

Stefan