Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Connect 2026 Agenda Now Available: Explore Sessions
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Sum Calculation

Hi Friends

i have a table which contains Name & Value like :

NAMEVALUE
ALL_123_ABC_***_56710
ALL_1234_***_ABC_56820
ALL_1234_###_56930
ALL_1234_57040
ALL_1234_CD_###_57150
ABC_1234_***_57260

Now i need to calculate the sum of value whose name should start with "ALL"  and the Name must contain *** or ###.

Thanks in Advance

Regards

Roopesh

1 Solution

Accepted Solutions
JonnyPoole
Former Employee
Former Employee

Attached has samples from load script, chart (calc dimension) and text box

Capture.PNG.png

View solution in original post

3 Replies
Not applicable
Author

sum(if(NAME like 'ALL*' and NAME like '*****' or NAME like '*###*', VALUE))

JonnyPoole
Former Employee
Former Employee

Attached has samples from load script, chart (calc dimension) and text box

Capture.PNG.png

its_anandrjs
Champion III
Champion III

Hi,

You can try this way also in the load script by adding two flags one for * and other for # symbols and load table and do sum in the front end.

Table1:

LOAD NAME,VALUE,if(Index(NAME,'***') = 0,0,1) as IndexString, if(WildMatch(NAME,'*###*'),1,0) as WildString;

LOAD * Inline

[

NAME, VALUE

ALL_123_ABC_***_567, 10

ALL_1234_***_ABC_568, 20

ALL_1234_###_569, 30

ALL_1234_570, 40

ALL_1234_CD_###_571, 50

ABC_1234_***_572, 60

];

Final:

LOAD

NAME,VALUE as Value

Resident Table1

Where (Left(NAME,3) = 'ALL' and IndexString = 1) or WildString = 1;

DROP Table Table1;

sum.png

Regards

Anand