cancel
Showing results for 
Search instead for 
Did you mean: 

Getting sum of a column in quotetable via script

Robin_32
Explorer
0 Kudos

Hello SAP,

I was trying to get the sum of a column of quote table where the columns rows are numbers.

I tried to write a script which adds all the rows of a column in quote table. The script goes as

"""

X=Quote.Quotetable['Quote Table Name']

For rows in X.Rows:

A=rows['Column Name']

""""

The variable A is getting the last row value of "Column Name" of QUOTE table "Quote Table Name".

Can anybody help on how to sum or add all the rows values of a particular column

Accepted Solutions (1)

Accepted Solutions (1)

patrick_latour3
Explorer

Hi Robin,

The script is almost correct. You are missing the addition... See below:

X=Quote.Quotetable['Quote Table Name']

For rows in X.Rows:

A += rows['Column Name']

Best,

Patrick

Answers (1)

Answers (1)

yogananda
Product and Topic Expert
Product and Topic Expert

robin32

For Quote 2.0

A = 0

X=context.Quote.QuoteTables['Testing']

for rows in X.Rows:

  A += rows['Amount']