Qlik Community

Qlik Sense App Development

Discussion board where members can learn more about Qlik Sense App Development and Usage.

paulyeo11
Valued Contributor II

Why i cannot divide by Rate in my GP% Expression ?

Hi All

I have below expression it alway display 0 % when i select SOURCE = TDSID :-

(

sum({$<YTD = {'-1'} , rEVENUE={rEVENUE}>}Amount)/Rate

-

sum({$<LY_YTD = {'-1'} , rEVENUE={rEVENUE}>}Amount)/Rate

)

/

sum({$<LY_YTD = {'-1'} , rEVENUE={rEVENUE}>}Amount)/Rate



After i remove the /Rate as below , And it work fine :-


(

sum({$<YTD = {'-1'} , rEVENUE={rEVENUE}>}Amount)

-

sum({$<LY_YTD = {'-1'} , rEVENUE={rEVENUE}>}Amount)

)

/

sum({$<LY_YTD = {'-1'} , rEVENUE={rEVENUE}>}Amount)


My question is why i need to remove /Rate to make it work ? as logically it is a constants , so it should not affect the result. but it does .


Paul

1 Solution

Accepted Solutions
MVP
MVP

Re: Why i cannot divide by Rate in my GP% Expression ?

And if you put the RATE inside the Sum?

sum({$<YTD = {'-1'} , rEVENUE={rEVENUE}>} Amount/Rate)

3 Replies
paulyeo11
Valued Contributor II

Re: Why i cannot divide by Rate in my GP% Expression ?

Hi All

My QVF Doc

MVP
MVP

Re: Why i cannot divide by Rate in my GP% Expression ?

And if you put the RATE inside the Sum?

sum({$<YTD = {'-1'} , rEVENUE={rEVENUE}>} Amount/Rate)

paulyeo11
Valued Contributor II

Re: Why i cannot divide by Rate in my GP% Expression ?

Hi Sir

If what you said is correct , the error due to rate must place inside the sum.

Why I only get 0% when source = TDSID ?

Paul

Sent from my iPhone