Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Good moring,
I ask for your advice because I want to do calculating in a script.
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 ?
Thanks for your reply
Alphonse
Alphonse
Is there a common field between your 2 tables that can be used to link them ?
Best Regards, Bill
Hello,
Tkanks for your reply.
No, there are 2 tables independants
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
Hello,
If I understand, maybe you can try something like this
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...
Tkanks in advance
Alphonse
Hi,
I forgot to join the pic on tables
Alphonse
If your source data is in Excel file could you share them with us ?
Best Regards, Bill
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.
Thanks in advance.
Alphonse
Hello Alphonse,
The script in Test.qvw is the following:
TABLE_1_TMP:
LOAD * INLINE [
FirstColumnT1
1
2
3
4
5
6
7
8
9
10
];
TABLE_2_TMP:
LOAD * INLINE [
FirstColumnT2
5.5
3.2
1.9
4.3
8.0
7.5
2.2
9.1
0.8
7
];
TABLE1:
LOAD FirstColumnT1 as Investissement,
RowNo() AS INDICE
Resident TABLE_1_TMP;
DROP Table TABLE_1_TMP;
Join(TABLE1)
TABLE2:
LOAD FirstColumnT2 as ki,
RowNo() as INDICE
Resident TABLE_2_TMP;
DROP Table TABLE_2_TMP;
TABLE3: // RESULT
LOAD *,
Investissement*ki as Result
Resident TABLE1;
DROP Table TABLE1;
Best regards.