Qlik Community

Ask a Question

New to Qlik Sense

If you’re new to Qlik Sense, start with this Discussion Board and get up-to-speed quickly.

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
Creator

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)

Before develop something, think If placed (The Right information | To the right people | At the Right time | In the Right place | With the Right context)
Bukan4x4
Contributor III
Contributor III
Author

Thanks, but that isn't the result.

JMAROUF
Creator
Creator

Hi @Bukan4x4 

try this.

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

 

View solution in original post

Anil_Babu_Samineni

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

Before develop something, think If placed (The Right information | To the right people | At the Right time | In the Right place | With the Right context)
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.