Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
sevvalk
Creator
Creator

Stock amount calculation by group.

Hello, I want to multiply the stock amount and unit price of each product in the warehouse and collect them according to product groups.

The Stock Unit Price formula is as follows:
if(ref_smsbc4<0,if(fldcev<0,((fldfyt)*Parity/(fldcev)*(-1)),(fldfyt)*Parity*(fldcev))/(ref_smsbc4*(-1)),
if(fldcev<0,((fldfyt)*Parity/(fldcev)*(-1)),(fldfyt)*Parity*(fldcev))*ref_smsbc4)

The formula is a bit complicated, but there are conversion factors.

The formula for Stock Quantities is as follows:

sum((mzngrm + mznbgm) - (mznckm + mznbcm))

Each product code has a unit price and quantity in stock, and each product has a group.
I want to bring the total amounts of these products according to their groups.
However, when I multiply the stock amount formula with the stock amount formula, I cannot get the correct data according to the groups. How can I do this if I want to multiply and add them separately for each product and thus include them in the calculation by group?

 

2 Replies
Chanty4u
MVP
MVP

Try this

If(ref_smsbc4 < 0,

        If(fldcev < 0,

            ((fldfyt) * Parity / (fldcev) * (-1)),

            (fldfyt) * Parity * (fldcev)

        ) / (ref_smsbc4 * (-1)),

        If(fldcev < 0,

            ((fldfyt) * Parity / (fldcev) * (-1)),

            (fldfyt) * Parity * (fldcev)

        ) * ref_smsbc4

    ) AS Individual_Amount

sevvalk
Creator
Creator
Author

It doesn't work.