Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
paulyeo11
Master
Master

Why need to compute by if XXX >1,1 then compute the sales / target ?

Hi All

Recently i notice that some of the QV expert when they try to compute sales vs target , i notice they alway use the below expression :-

(if((

Sum({$<year = {$(=Max(year)-0)}, month = {"<=$(=Max({<year={$(=Max(year))}, sales = {'*'}>} month))"}>}sales/1000/Rate)

/

Sum({$<year = {$(=Max(year)-0)}, month = {"<=$(=Max({<year={$(=Max(year))}, sales = {'*'}>} month))"}>}sales_target/1000/Rate)

)

>1,1,

(

Sum({$<year = {$(=Max(year)-0)}, month = {"<=$(=Max({<year={$(=Max(year))}, sales = {'*'}>} month))"}>}sales/1000/Rate)

/

Sum({$<year = {$(=Max(year)-0)}, month = {"<=$(=Max({<year={$(=Max(year))}, sales = {'*'}>} month))"}>}sales_target/1000/Rate)

)))

All the while i am using below appraoch :-

sum({$<year = {$(=max(year))}, month = {"<=$(=max({<year={$(=max(year))}>} month))"}>} sales/Rate/1000)

/

sum({$<year = {$(=max(year)-0)}, month = {"<=$(=max({<year={$(=max(year))}>} month))"}>}sales_target/Rate/1000)

I Do notice the different of above 2 expression , mine is able to see the sales vs target actual % , but the first appraoch is stop at 100%.

May i know in what situation need to apply if ?

Paul

1 Solution

Accepted Solutions
settu_periasamy
Master III
Master III

Yes, if we need the original % value, then we don't want to apply 'if' statement.

View solution in original post

3 Replies
settu_periasamy
Master III
Master III

Regarding the 1st expression, if we don't want to see more than 100% we can apply the if statement.

It is forcefully / manually make it as 100% when the Sales vs Target >100.

like

if(Sales vs Target > 100% then Make it as 100% (some of them don't want to see more than 100%),

else the normal calculation.

paulyeo11
Master
Master
Author

Hi Sir

Thank you very much for your clarify.

So can I said if I compute table to display target achievement . I should not apply if .

For plot % chart then I need to use if to limit 100%. Right ?

Paul

Sent from my iPhone

settu_periasamy
Master III
Master III

Yes, if we need the original % value, then we don't want to apply 'if' statement.