Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Announcements
QlikView Fans! We’d love to hear from you.
Share your QlikView feedback with the product team… Click here to participate in our 5-minute survey.
Rules, plus terms and conditions, can be found here.
nboccassini
Contributor

How to copy previous day data?

Hi, I have a big table (36 million rows) like this (the real table has 4 different price columns):

PlaceCategoryDate(dd/mm/yyyy)Price
A101/01/201410
A102/01/2014
A103/01/20148
............
A201/01/20145
A202/01/2014
A203/01/2014
B.......

I want that the places without price (for a category) have the last price:. For example

PlaceCategoryDate(dd/mm/yyyy)Price
A101/01/201410
A102/01/201410
A103/01/20148
............
A201/01/20145
A202/01/20145
A203/01/20145
B.........

Now I use the peek function for copy the last price, but the the reload is more slow.

Is there a faster way?

Thanks

3 Replies

Re: How to copy previous day data?

You could use an aggregation like this:

lastprice:

Load Place, max(Date) as MaxDate, Price From xyz Group by Place, Price;

But better for performance by 36M rows is to use incremental loads: Incremental Load. Also it could be that's more and/or enough performant to use firstsortedvalue() within the gui instead to calculate it in the script.

- Marcus

ecolomer
Honored Contributor II

Re: How to copy previous day data?

Use function ABOVE or BEFORE

sathishkumar_go
Contributor III

Re: How to copy previous day data?

HI,

Try this,

load

Place,

Category,

Date,

if(isnull(Price),peek(Price),Price) as New_Price,

Price

from table;

-Sathish

Community Browser