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

multiply different factors

Hello there,

Help me with this please: I need to calculate the "Result Taxes" of multiple Companies.

CompanyTaxesTurnoverCost
A0.210050
B0.315025
C0.220070

Also, I Have different money Exchange rate:

Moneyexchange_rate
Dolar700
Eur900

 

I have this variable working fine:

vTurnover= [Turnover]*[exchange_rate]

vCost =[Cost]*[exchange_rate]

vResult= vTurnover - vCost

But I tried to calculated Result Taxes this way:

=vResult*Taxes

the result is showing correctly when companies selected have the same Taxes values, Like Companie A and C, if Companies A and B are selected no result is shown.

How I can solve this?

Thanks in advance.

Labels (1)
1 Solution

Accepted Solutions
JMAROUF
Creator II
Creator II

Hi @Bukan4x4 

try this.

vResultTax=sum(((Turnover-Cost)*exchange_rate)*Taxes)

 

View solution in original post

6 Replies
Anil_Babu_Samineni

Perhaps this?

((Sum([Turnover])*Sum([exchange_rate]))-(Sum([Cost])*Sum([exchange_rate])))*Sum(Taxes)

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
Bukan4x4
Contributor III
Contributor III
Author

Thanks, but that isn't the result.

JMAROUF
Creator II
Creator II

Hi @Bukan4x4 

try this.

vResultTax=sum(((Turnover-Cost)*exchange_rate)*Taxes)

 

Anil_Babu_Samineni

When you say that is not the expected result, can you brief little more to understand?

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
Bukan4x4
Contributor III
Contributor III
Author

Anil, isn't correct because you sum all Taxes values and this result is multiplied by the other values.

In my tables, if companies A and B are selected, SUM(taxes) = 0,5. Is not the expected result.

Thanks anyway.

 

 

 

Bukan4x4
Contributor III
Contributor III
Author

Thanks JMarouf, That worked!

But my real code is pretty more complicated than I resume here, I expected to calculate the Tax using my variables directly, but I think isn't possible.