Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

inigoelv
Contributor

Problem formul with 2 variables

Hello:

I have problem with the use of two variables in a formula:

1) vReception= Aggr ( Sum ({<TYPE={"Reception"}>} Quantity) MonthYear, Supplier) . Per example: 25.000 kg

2) vClaim= Aggr ( Sum ({<TYPE={"Claim"}>} Quantity) MonthYear, Supplier) . Per example: 1000 kg

When I calcul in an expression:

%=$(vClaim)/$(vReception) the result is only the first formul: 1000 kg instead of 1000/25000= 0,04


The result is like only use the first formul an forget to divide by the second.

The table is:

MonthYearSupplierTypeQuantity
01/2013AReception25000
01/2013AClaim1000

Thanks in advance.

5 Replies
Not applicable

Re: Problem formul with 2 variables

Do you have a solution for this issue? I have the same problem.

Not applicable

Re: Problem formul with 2 variables

You need this expression in the text object ?

Not applicable

Re: Problem formul with 2 variables

Use

Let vClaim and

Let vReception

to solve the problem.

MVP
MVP

Re: Problem formul with 2 variables

using input box with these expressions

vC  =         Aggr ( Sum ({<Type={"Reception"}>} Quantity), MonthYear, Supplier)

vR =         Aggr ( Sum ({$<Type={"Claim"}>} Quantity), MonthYear, Supplier)

I get 0.04 for

=$(vC) / $(vR)

chiru_thota
Valued Contributor

Re: Problem formul with 2 variables

Hi,

Use = symbol in variables .you can get that.

have a look at attached QVW.

Example.jpg

Community Browser