6 Replies Latest reply: Jul 3, 2016 12:12 PM by Yeo Poh sai

# 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

my qvf

• ###### Re: Expression Column(1) / Column(2) work but use full expression not work in QS

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)

• ###### Re: Expression Column(1) / Column(2) work but use full expression not work in QS

Hi Vin

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

Paul

• ###### Re: Expression Column(1) / Column(2) work but use full expression not work in QS

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

• ###### Re: Expression Column(1) / Column(2) work but use full expression not work in QS

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

• ###### Re: Expression Column(1) / Column(2) work but use full expression not work in QS

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