10 Replies Latest reply: Dec 11, 2013 12:11 PM by Bill Markham

# Multiply Table content by Cofficient

Good moring,

I really don't know how to write relation.

Table [Investissement]     Table [ki]

A                                       k1

B                                       k2

C                                       k3

..                                        ..

..                                        ..

N                                        kn

To obtain Sum (A*k1 + B*k2 + C*k3.... N*kn)

And realised the Sum of all multiply

Do y use loop ? and Incrément ?

Alphonse

• ###### Re: Multiply Table content by Cofficient

Alphonse

Is there a common field between your 2 tables that can be used to link them ?

• [Investissement]
• [ki]

Best Regards,     Bill

• ###### Re: Multiply Table content by Cofficient

Hello,

No, there are 2 tables independants

• ###### Re: Multiply Table content by Cofficient

Alphonse

How would one know which row value from [Investissement] to multiply with which row value from [ki] ?

And what table with what fields would you want this calculated value placed in ?

I am quite confused here, so it would be great if you could share a sample qvw, with some sample data via an Inline load, plus a description of the output table field you are after ?

Best Regards,     Bill

• ###### Re: Multiply Table content by Cofficient

Hello,

If I understand, maybe you can try something like this

• ###### Re: Multiply Table content by Cofficient

Good morning,

Sorry, I can't read Test.qvw, because I am testing this produit.

In fact I try to calculate IRR on a projet. I have 2 tables : Resultat and Coefficient as this picture.

Actually I do this on Excel file and after reload the result. But I would like to try multiply this 2 tables in another table result which is empty at the begining. And if possible to make SUM of all figures.

But I am beginner on QV...

Alphonse

• ###### Re: Multiply Table content by Cofficient

Hi,

I forgot to join the pic on tables

• ###### Re: Multiply Table content by Cofficient

Alphonse

If your source data is in Excel file[s] could you share them with us ?

Best Regards,     Bill

• ###### Re: Re: Multiply Table content by Cofficient

Hello Bill,

Yes

I have 2 tables : Resultat and Coefficient

I would like in QV multiply each ligne and obtain calculation and a Resulte table. And If possible make the Sum of all data in Result.

Alphonse

• ###### Re: Re: Re: Multiply Table content by Cofficient

Alphonse

One thing at time....

Data:

Investissement,

Recette,

Resultat,

[Valeur du coefficient],

( Resultat *  [Valeur du coefficient] ) as [Derived Value] ,

F6

FROM

Sample_data.xls

(biff, embedded labels, table is Engagement\$);

Best Regards,    Bill

• ###### Re: Multiply Table content by Cofficient

Hello Alphonse,

The script in Test.qvw is the following:

TABLE_1_TMP:

FirstColumnT1

1

2

3

4

5

6

7

8

9

10

];

TABLE_2_TMP:

FirstColumnT2

5.5

3.2

1.9

4.3

8.0

7.5

2.2

9.1

0.8

7

];

TABLE1:

RowNo() AS INDICE

Resident TABLE_1_TMP;

DROP Table TABLE_1_TMP;

Join(TABLE1)

TABLE2:

RowNo() as INDICE

Resident TABLE_2_TMP;

DROP Table TABLE_2_TMP;

TABLE3: // RESULT

Investissement*ki as Result

Resident TABLE1;

DROP Table TABLE1;

Best regards.