Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
nboccassini
Partner - Creator
Partner - Creator

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
marcus_sommer

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
Master II
Master II

Use function ABOVE or BEFORE

sathishkumar_go
Partner - Specialist
Partner - Specialist

HI,

Try this,

load

Place,

Category,

Date,

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

Price

from table;

-Sathish