HomeForum
Welcome, Guest

Calculation based on previous row
(1 viewing) (1) Guest
  • Page:
  • 1

TOPIC: Calculation based on previous row

Calculation based on previous row 1 year, 2 months ago #1969

  • Scott
  • OFFLINE
  • Junior Boarder
  • Posts: 24
  • Karma: 0
Hello

I am trying to calculate the stock (new column) based on previous row
if the Article=prevArticle AND Store=prevStore .

Date,Article,Store,Movement,Qty
12-01-2011,Banana001,aaa,In,21
13-01-2011,Banana001,aaa,in,82
13-01-2011,Banana001,aaa,out,180
13-01-2011,Banana001,bbb,in,121
14-01-2011,Banana001,bbb,out,51

My dream result text file is:

Date,Article,Store,TypeMovement,Qty,Stock
12-01-2011,Banana001,aaa,In,21,21
13-01-2011,Banana001,aaa,In,8,29
13-01-2011,Banana001,aaa,out,18,11
13-01-2011,Banana001,bbb,in,12,23
14-01-2011,Banana001,bbb,out,5,18

Any Help is welcome

John Scott

Re: Calculation based on previous row 1 year, 2 months ago #1970

  • admin
  • NOW ONLINE
  • Moderator
  • Posts: 2182
  • Karma: 12
Hello

This can be done by using 'running total' function

I have created a working example for you

extract all files into c:\support directory

Peter
  • Page:
  • 1
Time to create page: 0.15 seconds

Testimonials

"Using Visual Importer ETL was a lot easier than we expected it to be, and had a lot more functionality than our other software."

Daniel Boel,
Information Technology Manager

User Login

You only need to log in or register to use our support forum



Our customers

BP

BBC

HSBC


Databases we work with

Go to top