11 Replies Latest reply: Jun 3, 2016 4:43 PM by fabio Mazzarelli

# howto: sum a data list

Hi Community,

could you help me?

A table contains these values:

Name                     Number

BOOK 1      ........... 20

BOOK 2 ................. 4

A12345 ...............    34

G45677 .................. 3

901020 ................   34

FRUIT ................. 34

DISK ..................  123

H12497 ..............    3

HowTo sum only:

A12345

G45677

901020

H12487

• ###### Re: howto: sum a data list

May be this:

Sum({<Name = {'A12345', 'G45677', '901020', 'H12487'}>}Number)

• ###### Re: howto: sum a data list

Hi,

t is more complicated because I do not know the list of items to be added. I could use a formula that allows to recognize that the value contains numbers.

So that,

if the value contains a high number otherwise not rule it out.

cludo.

• ###### Re: howto: sum a data list

Try to give Condition on Number

Sum({<Number= {"<=34"}>}Number)

• ###### Re: howto: sum a data list

Wouldn't this Sum DISK also?

• ###### Re: howto: sum a data list

perfect.

• ###### Re: howto: sum a data list

So which of the solutions finally worked?

• ###### Re: howto: sum a data list

Hi

the solutions finally worked is

Sum({<Name = {"=KeepChar(Name, '0123456789') * 1 > 10"}>}Number)

Now,

may I group them in a linear table?

A12345 10

G45677 20

901020  5

H12487  50

NewName  = 85

NewName is the sum of A12345, G45677, 901020, h12487

• ###### Re: howto: sum a data list

Create Straight table

Dimension:

=Valuelist('NewName1','NewName2')

Expression:

=Pick(Match(Valuelist('NewName1','NewName2'),'NewName1','NewName2'),

Sum({<Name = {"=KeepChar(Name, '0123456789') * 1 > 10"}>}Number),

Sum({<Name = {"=KeepChar(Name, '0123456789') * 1 > 20"}>}Number))

• ###### Re: howto: sum a data list

Not sure I understand your followup question?

• ###### Re: howto: sum a data list

Hi,

A table contains these values:

Name                     Quantity 1                Quantity2

BOOK 1      ........... 20                                   0

BOOK 2 ................. 4                                    0

A12345 ...............    34                                5

G45677 .................. 3                                  4

901020 ................   34                                5

FRUIT ................. 34                                    0

DISK ..................  123                                  0

H12497 ..............    3                                   3

The formula should be:

1) create a table (table1) containing ONLY values (A12345, G45677, H12497)

please note that table contains hundreds of values and it's impossibile to list them

2) create a new formula

if Name is equal to one of those present in the table1, (quantity1 + quantity2), quantity1