Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
paulyeo11
Master
Master

Expression Column(1) / Column(2) work but use full expression not work in QS

Hi All

My Column 1 Expression work fine :-


Sum({$<year = {$(=Max(year)-0)}, month = {"<=$(=Max({<year={$(=Max(year))}, sales = >} month))"},COUNTRY_={[CASH SALES],'Singapore','EXPORT'}>}sales/Rate)

My Column 2 Expression work fine :-

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

I need to compute Ratio of Column(1) and Column(2) as below expression :-


Sum({$<year = {$(=Max(year)-0)}, month = {"<=$(=Max({<year={$(=Max(year))}, sales = >} month))"},COUNTRY_={[CASH SALES],'Singapore','EXPORT'}>}sales/Rate)
/
Sum({$<year = {$(=Max(year)-0)}, month = {"<=$(=Max({<year={$(=Max(year))}, sales = >} month))"}}>}sales/Rate)

But it return null , can some one advise me.

I cannot make use of Column(1) / Column(2) , because i will be apply the expression in KPI.

Paul

1 Solution

Accepted Solutions
marcus_sommer

There is a small syntax-error within your kpi-expression:

Sum({$<year = {$(=Max(year)-0)}, month = {"<=$(=Max({<year={$(=Max(year))}, sales = >} month))"},COUNTRY_={[CASH SALES],'Singapore','EXPORT'}>}sales/Rate)

/

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

- Marcus

View solution in original post

6 Replies
paulyeo11
Master
Master
Author

my qvf

vinieme12
Champion III
Champion III

Hi Paul,

Frankly I do not understand a percentage / percentage kpi

But perhaps the below could be meaningful.

(Sum({$<year = {$(=Max(year)-0)}, month = {"<=$(=Max({<year={$(=Max(year))}, sales = >} month))"},COUNTRY_={[CASH SALES],'Singapore','EXPORT'}>}sales)

-

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

Vineeth Pujari
If a post helps to resolve your issue, please accept it as a Solution.
vinieme12
Champion III
Champion III

O you could also refer to the column names instead of referring to them by column number

Vineeth Pujari
If a post helps to resolve your issue, please accept it as a Solution.
Digvijay_Singh

You got small formatting error in second expression -

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


Remove one bracket and it will work

marcus_sommer

There is a small syntax-error within your kpi-expression:

Sum({$<year = {$(=Max(year)-0)}, month = {"<=$(=Max({<year={$(=Max(year))}, sales = >} month))"},COUNTRY_={[CASH SALES],'Singapore','EXPORT'}>}sales/Rate)

/

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

- Marcus

paulyeo11
Master
Master
Author

Hi Vin

I already got the solution from the answer provide by 2 user , as i have accidently insert one more {{

Paul