11 Replies Latest reply: Sep 16, 2013 3:05 AM by Paul Yeo

# Sum(CY)/Sum(TOTAL(CY)) not working

Hi All

I hv below expression work fine :-

Sum(sales)/Sum(TOTAL(sales))

I try below expression using label name :-

Sum(CY)/Sum(TOTAL(CY))

it does not able to work.

Can some one advise me ?

Paul

• ###### Re: Sum(CY)/Sum(TOTAL(CY)) not working

I have not opened your QVW, Where are you generating CY, if it a variable then you need to expand it using \$ eg. below ...

Sum(\$(CY)/Sum(TOTAL(\$(CY))

• ###### Re: Sum(CY)/Sum(TOTAL(CY)) not working

Hi Scot

Your solution not able to work , because it is not system variable.

I use expression label name.

money(

sum({\$<year = {\$(=max(year)-0)}

,[Reporting Code] = {

As my CY expression is below :-

">=00100<=

00374"

}

, month = {"<=\$(=max({<year={\$(=max(year))}>} month))"}>} Amount/\$(ColumnDim98)*-1)/1000

, \$(vMoneyFormatK_GL))

Paul

• ###### Re: Sum(CY)/Sum(TOTAL(CY)) not working

First try to clean your data model, later see what happens

• ###### Re: Sum(CY)/Sum(TOTAL(CY)) not working

You are using a wrong syntax...

This is what you are using...this will give you undesired outputs..

Sum(Money(Sum(Expression)))/Sum(TOTAL Money(Sum(Expression)))

I have attached a solution..I am using the concept of "Relative" in expression.

See if that helps.

Phani

• ###### Re: Sum(CY)/Sum(TOTAL(CY)) not working

Hi,

Try this expression for Contri

=sum({\$<year = {\$(=max(year)-0)}
,[Reporting Code] = {

">=00100<=
00374"
}

, month = {"<=\$(=max({<year={\$(=max(year))}>} month))"}>} Amount/\$(ColumnDim98)*-1)/
sum( {\$<year = {\$(=max(year)-0)}
,[Reporting Code] = {

">=00100<=
00374"
}

, month = {"<=\$(=max({<year={\$(=max(year))}>} month))"}>} TOTAL Amount/\$(ColumnDim98)*-1)

Regards,

Jagan.

• ###### Re: Sum(CY)/Sum(TOTAL(CY)) not working

Is this what you want? PFA

• ###### Re: Sum(CY)/Sum(TOTAL(CY)) not working

Hi,

Use the label name in between the square brackets like Sum([CY])/Sum(TOTAL([CY]))

Hope it helps you

• ###### Re: Sum(CY)/Sum(TOTAL(CY)) not working

Please find the attachment......... hope it is solved.......... adn validate with text object.......

• ###### Re: Sum(CY)/Sum(TOTAL(CY)) not working

Hi All

Thank you very one for your help . I must said those who expression = CY  is the best . as it is less work and achieve the same result.

Some one suggest to me clean my data model , yes i admit my data model is messy. i already try few time but fail. because not easy to handle link table. also partly i am not a programmer. but it is just like live in poor country , a bit of hard to change the environment, but i will try.

Paul

• ###### Re: Sum(CY)/Sum(TOTAL(CY)) not working

Paul

Moving forward, for future solutions I would see it as a priority to clean/rationalise your data model

Life will be so hard for you with a model like what you have now (no offence, but it is an example of

how not to model)...

Cheers

Paul

• ###### Re: Sum(CY)/Sum(TOTAL(CY)) not working

Hi Scot

Thank you for reminding me again. Sure one day will come my data model will be neat.

Paul