cancel
Showing results for 
Search instead for 
Did you mean: 

Multiplication of 2 columns value

Former Member
0 Kudos

Hi

I am new to BODS.I have used * operator for multiplication of 2 columns values,for store the result I have taken New column.After run the Pack the new column contains same value as first record multiplication value.

Thank you.

Example:

Column1    Column2    NewColumn

1                    5               5

2                    3               5    

3                    1               5

4                    0               5   

Accepted Solutions (0)

Answers (3)

Answers (3)

former_member211387
Contributor
0 Kudos

If the columns with data are brought in as input schema then it is fairly straightforward as mentioned by other experts in this chain. There is no need to write a sql function within the mapping. It will definitely have an impact on performance when you are handling large volumes.

Raghu

former_member187605
Active Contributor
0 Kudos

It will actually produce totally incorrect results, as you may have noticed.

The sql function returns the first 1020 characters from the query output. Typically, if the sql command passed as parameter is a SELECT statement, the return value is the first row value of the first column. And that happened to be 5 in this case.

Former Member
0 Kudos

Hi Dirk,

Yes, you are right.

former_member200473
Contributor
0 Kudos

Hi Dirk, 

what should be solution to it. ?

Regards,

Shiva Sahu

former_member187605
Active Contributor
0 Kudos

As I said, don't use the sql built-in function, simply map TotalPrice to PRICE * QTY.

Former Member
0 Kudos

Hi,

Just you can do the mapping like below:

In the mapping tab for the new column

(column1 * coumn2)

Former Member
0 Kudos

Thank you Srinivas

former_member187605
Active Contributor
0 Kudos

Try PRICE * QTY in the mapping for TotalPrice

Former Member
0 Kudos

Thank you Dirk