Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Announcements
QlikView Fans! We’d love to hear from you.
Share your QlikView feedback with the product team… Click here to participate in our 5-minute survey.
Rules, plus terms and conditions, can be found here.
Not applicable

Growth formula

I have standard formula: 

 

=[$(=$(lTranslation(132,YOY $ vs FxLY)))]

/[$(=$(lTranslation(65,FxLY Sales)))]

which does the trick for positive growth but what if FxLY sales are negative and YOY positive?

how would you write something like this:

if FxLY is negative than calculate =(B1-B2)/ABS(B2) otherwise =[$(=$(lTranslation(132,YOY $ vs FxLY)))]/[$(=$(lTranslation(65,FxLY Sales)))]

7 Replies
Not applicable

Re: Growth formula

anyone?

atkinsow
Valued Contributor II

Re: Growth formula

Can't you just put fabs() around your denominator?

Not applicable

Re: Growth formula

=[$(=$(lTranslation(132,YOY $ vs FxLY)))]

/([$(=$(lTranslation(65,FxLY Sales)))])

like the above? it didnt work.

Not applicable

Re: Growth formula

just to make sure what i am looking for:

how would you write something like this:

if FxLY is negative than calculate =(B1-B2)/ABS(B2) otherwise =[$(=$(lTranslation(132,YOY $ vs FxLY)))]/[$(=$(lTranslation(65,FxLY Sales)))]

where B1 =[$(=$(lTranslation(132,YOY $ vs FxLY)))]

and B2 = [$(=$(lTranslation(65,FxLY Sales)))]

atkinsow
Valued Contributor II

Re: Growth formula

I mean like this

=[$(=$(lTranslation(132,YOY $ vs FxLY)))]

/FABS(([$(=$(lTranslation(65,FxLY Sales)))]))

Re: Growth formula

What is FxLY here? and what is B1, B2 here? are these all field names?

Not applicable

Re: Growth formula

it worked.  thank you.

Community Browser