Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
tinapullen1
Contributor
Contributor

Sumif based on field detail

Hi,

 

I'm trying to write into script a formula to allow me to "sumif" fields based on the criteria.  e.g. I have trip numbers that have many lines & each line has a pallet count.  I would like a "results" field that adds up the pallet count based on the trip number.  Example below - trip 1 has 2 lines of detail 1 being 5 plts, 1 being 2 plts.  The result would be 7. 

Trip                     Plts                      Result

1                           5                           7

1                           2                           7

Thanks in advance

3 Replies
sergio0592
Specialist III
Specialist III

Hi,

Try with

sum(TOTAL <Trip> Plts)
tinapullen1
Contributor
Contributor
Author

Hi Sergio, 

I can use this formula in the script?  

Thanks

 

Taoufiq_Zarra

@tinapullen1 

Data:
load * inline [
Trip,Plts

1,5

1,2 
];
left join load Trip ,sum(Plts) as Result resident Data group by Trip;

 

Taoufiq_Zarra_0-1604931038181.png

 

Regards,
Taoufiq ZARRA

"Please LIKE posts and "Accept as Solution" if the provided solution is helpful "

(you can mark up to 3 "solutions") 😉