Skip to main content
Woohoo! Qlik Community has won “Best in Class Community” in the 2024 Khoros Kudos awards!
Announcements
Nov. 20th, Qlik Insider - Lakehouses: Driving the Future of Data & AI - PICK A SESSION
cancel
Showing results for 
Search instead for 
Did you mean: 
fmazzarelli
Partner - Creator III
Partner - Creator III

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

11 Replies
sunny_talwar

May be this:

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

fmazzarelli
Partner - Creator III
Partner - Creator III
Author

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.

Kushal_Chawda

Try to give Condition on Number


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

sunny_talwar

How about this:

Sum({<Name = {"=Len(KeepChar(Name, '0123456789')) > 0"}>}Number)


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

sunny_talwar

Wouldn't this Sum DISK also?

fmazzarelli
Partner - Creator III
Partner - Creator III
Author

perfect.

sunny_talwar

So which of the solutions finally worked?

fmazzarelli
Partner - Creator III
Partner - Creator III
Author

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

Kushal_Chawda

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))