5 Replies Latest reply: Feb 23, 2012 11:04 AM by Dayna Litherland

# 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

• ###### Re: Continuation of a line/value with the last record

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.

• ###### Re: Continuation of a line/value with the last record

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!

• ###### Re: Continuation of a line/value with the last record

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

• ###### Re: Continuation of a line/value with the last record

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

• ###### Re: Continuation of a line/value with the last record

I was so close... Thanks again Henric!