Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

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

1 Solution

Accepted Solutions
tresesco
MVP
MVP

Is this what you want? PFA

View solution in original post

11 Replies
paul_scotchford
Specialist
Specialist

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))

phaneendra_kunc
Partner - Specialist III
Partner - Specialist III

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

Not applicable
Author

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

jolivares
Specialist
Specialist

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

jagan
Luminary Alumni
Luminary Alumni

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.


tresesco
MVP
MVP

Is this what you want? PFA

Not applicable
Author

Hi,

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

Hope it helps you

Not applicable
Author

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

Not applicable
Author

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