HomeForum
Welcome, Guest

Writing custom transformations
(1 viewing) (1) Guest
  • Page:
  • 1

TOPIC: Writing custom transformations

Writing custom transformations 1 year, 1 month ago #2651

  • Matt
  • OFFLINE
  • Fresh Boarder
  • Posts: 13
  • Karma: 0
I was trying to do some math using Transformation->Calculation->Calculation Properties->Editor
(I do understand some Pascal - use Delphi sometimes)

How do I reference my columns?
Also, I want to reference a previous value. How?

I have, for example, date based data and I have a column for today's last price called "Close".

I want, as a simple example, calculate average of yesterdays price and today's, like in metacode:

AvgClose:=(Close(0) + Close(-1))/2;

Where AvgClose is a value I want added to other written output data.
Would appreciate help with this.

Thanks,
Matt

Re: Writing custom transformations 1 year, 1 month ago #2653

  • admin
  • OFFLINE
  • Moderator
  • Posts: 2182
  • Karma: 12
Hello.

Have a look at Basic Calculation Examples in documentation.

Also, I want to reference a previous value. How?

To be honest I do not quite understand what are you trying to achieve.
May be all you need to do is to sort than group you data and calculate average?

Mike

Re: Writing custom transformations 1 year, 1 month ago #2654

  • Matt
  • OFFLINE
  • Fresh Boarder
  • Posts: 13
  • Karma: 0
Mike,

I will try to use the provided examples to understand calculator basics.

The second problem I do not think is solved by using grouping.

In the example I stated, I only wanted to do a moving average by referencing the previous record together with present, i.e. using previous data row - or more generally any row.

I want to know if it is possible, because it would simplify a lot and would help me do a lot of things I otherwise would use Delphi or Excel for. I can still do it that way, but I saw a really great potential here, if the database converter could be used to take care of more of my data transformations. They very ofter reference other rows or records than the present.

I'll play more with the program so that I can be more specific and experienced when I ask.

Thanks,
Matt

Re: Writing custom transformations 1 year, 1 month ago #2655

  • admin
  • OFFLINE
  • Moderator
  • Posts: 2182
  • Karma: 12
I see what you mean now

There is a function called Previous Value, which will do what you wanted.

Looking forward to more feedback from you,
Mike
  • Page:
  • 1
Time to create page: 0.17 seconds

Testimonials

"I needed to integrate and automate disparate systems running different database platforms that speak different languages, even different flavors of SQL. Visual Importer products have become that common link for me."

Gene Kovacs,
Director of Technical Business Operations,
A2B

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