# QlikView App Development

Discussion Board for collaboration related to QlikView App Development.

Announcements
Contributor III

## Expression help

Hi All,

i Have the below expression written in script:

(if(if(IsNull(YTD_Consumption_LY),0,YTD_Consumption_LY)=0,if(IsNull(Cons_YTD_LY),0,-Cons_YTD_LY),

I am getting the value as 467K

Now when i write the below expression in text box i.e.

=sum(if(if(IsNull(YTD_Consumption_LY),0,YTD_Consumption_LY)=0,if(IsNull(Cons_YTD_LY),0,-Cons_YTD_LY),

i am gettiing the value i.e. 568K

Thanks,

Bharat

6 Replies
Esteemed Contributor

## Re: Expression help

Hi,

would you be able to attach sample data or sample app ?

Valued Contributor II

## Re: Expression help

hello

maybe the 2 sum() functions in your 2nd expression

if i understand, the 1st one i equivalent to a*b . if you sum, it is sum(a*b)

and in the 2nd, it is more sum(a)*sum(b)

which is mathematically different

Contributor III

## Re: Expression help

Hi Robin,

The correct formula is:

I need to represent this in

(if(if(IsNull(YTD_Consumption_LY),0,YTD_Consumption_LY)=0,if(IsNull(Cons_YTD_LY),0,-Cons_YTD_LY),

Can you please tell where i am doing wrong

Valued Contributor II

## Re: Expression help

the 1st one can be resumed as sum(a)*sum(b)/sum(c)

so you have to express your 2nd one on the same format, maybe like

sum(if( ........,a))*sum(if( .......,b))/sum(if( .......,c))

where if(....) is your if formulas and a,b,c, the 3 expressions you want to sum

Contributor III

## Re: Expression help

Hi,

I am just writing a simple expression as below:

Cons_YTD_LY*(ADJ_CONS_YTD_LY/YTD_Consumption_LY) but still the value is not matching..

Can you please let me know where iam doing wrong

Valued Contributor II

## Re: Expression help

you have to write your if() expressions