Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Not applicable

Sum of sales for a specific group

Hello everyone,

I have a table with two columns,Carrier and Sales. Carrier Field has two types of value one record for PRODUCE and one for DRY.

The issue is to show sum(sales) in a text object. But whenever a Produce carrier field is selected it sum(sales) for all PRODUCE field

the same with DRY field.

I have attached application and xls file.Please if anyone has any idea please share with me.

Thanks and Regards

bhawna

Tags (4)
1 Solution

Accepted Solutions
antoniotiman
Honored Contributor III

Re: Sum of sales for a specific group

Try

If(Match(SubField(CARRIER,'-',2),'PRODUCE'),Sum({<CARRIER={'*PRODUCE*'}>} Sales),

If(Match(SubField(CARRIER,'-',2),'DRY'),Sum({<CARRIER={'*DRY*'}>} Sales)))

Regards

3 Replies
jebamalai
Valued Contributor

Re: Sum of sales for a specific group

Use this in your Text Box and it worked

if(if(match(SubField(CARRIER,'-',2),'PRODUCE'),Sum(Sales))>0,if(match(SubField(CARRIER,'-',2),'PRODUCE'),Sum(Sales)),if(match(SubField(CARRIER,'-',2),'DRY'),Sum(Sales)))

antoniotiman
Honored Contributor III

Re: Sum of sales for a specific group

Try

If(Match(SubField(CARRIER,'-',2),'PRODUCE'),Sum({<CARRIER={'*PRODUCE*'}>} Sales),

If(Match(SubField(CARRIER,'-',2),'DRY'),Sum({<CARRIER={'*DRY*'}>} Sales)))

Regards

Not applicable

Re: Sum of sales for a specific group

Thank you Antonio..

Community Browser