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 and Division

Hi,

I'm trying to Sum column A and divide the total by column B but my expression is not giving me the correct total.

My expression is:

************************************************************************************************************************************

sum({<Registration_Code={'2'}, Vehicle_Status = {'Normal'}, Contract_Prefix={'A'},YMDate = DisplayYM>} [Total_proceeds])

/

sum({<Registration_Code={'2'}, Vehicle_Status = {'Normal'}, Contract_Prefix={'A'},YMDate = DisplayYM>} Market_Value)

************************************************************************************************************************************

When I add Total_proceeds in Excel and divide it by the sum of Market_Value, I get 46.74% but qlikview is showing 51.74%.

Is there something wrong with the expression or should the expression be totally different?

tx,

S

1 Solution

Accepted Solutions
Not applicable
Author

Hi,

Are you using straight table or you're using pivot? If you're using straight, you should be able to change Total to SUM OF ROWS.

If you're using pivot, you will have to change the expression to aggregate in first row (since you add filters to your expression via Set analysis).

Regards, Miha

View solution in original post

2 Replies
Not applicable
Author

Hi,

Are you using straight table or you're using pivot? If you're using straight, you should be able to change Total to SUM OF ROWS.

If you're using pivot, you will have to change the expression to aggregate in first row (since you add filters to your expression via Set analysis).

Regards, Miha

Not applicable
Author

thanks Miha, don't know how I could have missed that. Big Smile