Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
nitin_007
Contributor II
Contributor II

How to apply Sum(Total) in Final_New field

 

Hello All,

Final field is derived from Quantity * B.P, and in Final_New Field we want sum of final filed/sum of Quantity based on product. Below is the formula to derived the Final_New field.

=SUM(F2:F3)/SUM(D2:D3) 

Like wise for all the products.

Also attached the same data.

 
 
 

Thanks in advanced.

Question.PNG

Regards,

Nitin

2 Solutions

Accepted Solutions
sunny_talwar

Try this

Sum(TOTAL <Plant, Product> Quantity*B.P)/Sum(TOTAL <Plant, Product> Quantity)

 

View solution in original post

sunny_talwar

9 Replies
Frank_Hartmann
Master II
Master II

Maybe like attached

hope this helps

sunny_talwar

Try this

Table:
LOAD Plant, 
     Product, 
     Contract, 
     Quantity, 
     B.P,
     Quantity*B.P as final
FROM
[..\..\Downloads\Question_Community.xls]
(biff, embedded labels, table is Sheet1$);

Left Join (Table)
LOAD Plant, 
     Product,
     Sum(final)/Sum(Quantity) as Final_New
Resident Table
Group By Plant, Product;
nitin_007
Contributor II
Contributor II
Author

Hi Sunny,

I want des output in front end expression.

sunny_talwar

What dimensions do you have in your front end table? Also, is final (field) calculated in the script or is that something which you need calculated in the front end too?

nitin_007
Contributor II
Contributor II
Author

Dimensione field is  plant , Product, Contract.

final field is calculated in front end only, quantity*B.P=Final

sunny_talwar

Try this

Sum(TOTAL <Plant, Product> Quantity*B.P)/Sum(TOTAL <Plant, Product> Quantity)

 

nitin_007
Contributor II
Contributor II
Author

Hi Sunny,

 

Could you send me test.qvw application using my attached data.

sunny_talwar

PFA

Brett_Bleess
Former Employee
Former Employee

Nitin, did Sunny's sample app get you everything you needed? If so, do not forget to come back to the thread to mark that post using the Accept as Solution button to give credit for the help you received, and to let others know that worked.  If you are still working on things, please leave an update.

Regards,
Brett

To help users find verified answers, please do not forget to use the "Accept as Solution" button on any post(s) that helped you resolve your problem or question.
I now work a compressed schedule, Tuesday, Wednesday and Thursday, so those will be the days I will reply to any follow-up posts.