Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Dayna
Creator II
Creator II

Continuation of a line/value with the last record

Hello All,

I have an application that using a combination of previous and peek, calculates the current stock based on some records... The problem is, that the line stops if there isn't a change (as there isn't a record to calculate) so if there's only ever been one change/record, the line chart will show a dot.

What I would like to do, is continue the line even if there isn't a change - just a constant line!

I've created a simple application to show what the problem is, does anyone have any ideas? I'm hoping it's something very simple that I've overlooked!

Kind Regards,

Dayna

1 Solution

Accepted Solutions
hic
Former Employee
Former Employee

You need to create the cartesian products of all dates/months and products and populate missing values. Attached you will find one example of how to do this.

View solution in original post

5 Replies
hic
Former Employee
Former Employee

You need to create the cartesian products of all dates/months and products and populate missing values. Attached you will find one example of how to do this.

Dayna
Creator II
Creator II
Author

Wow, that's perfect - I've tested it on my complex data source, and it looks like it works! Thank you so much for your help!

Dayna
Creator II
Creator II
Author

Henric,

A quick query, based on the above - how would you add a site cartesian? For some products, they have mutliple sites, so ideally it would have a record with the previous value for the difference site combinations.

I thought it would be as simple as adding it to my rangesum expression and creating a cartesian site, but this didn't work. Your help would be appreciated!

Kind Regards,

Dayna

hic
Former Employee
Former Employee

I assume that you want to use the previous value for that specific product at that specific site (as opposed to the value at another site). Then the answer would be along what I have in the attachment.

It is basically the same, but with a couple of small changes:

* The cartesian product now has three dimensions (SITE, PRODUCT, TIME) instead of two

* In the final load statement you have to ORDER BY all three dimensions

* In the final load statement you need to test not only that PRODUCT=Peek(PRODUCT) but also that SITE=Peek(SITE)

And that's it...

Henric

Dayna
Creator II
Creator II
Author

I was so close... Thanks again Henric!