Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
AWS Degraded - You may experience Community slowness, timeouts, or trouble accessing: LATEST HERE
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

problem with summing the rows

my scenario i am having

salesman and manager level charts

in the both charts i am using the same expressions but in the salesman chart

the fields are like area,area num, salesman and in manager level   chart 1

area, region, manager    chart 2

here actually when i sue expression total in the total field the totals are wrong then i changed it to sum of rows then the total are true

but in the the chart 2 there is only one row it is giving me the result as per the expression

isthere any other way to write the expression

RangeSum((sum({<Week={12}>}Vol)/2),sum({<Week={12}>}DISTINCT Units)/2)

1 Solution

Accepted Solutions
Clever_Anjos
Employee
Employee

Find the "problem":

The expression shows different values because  "Mary Herrera" and "Rebecca O'Marrah" have same CB_UNITS, so when your graph splits by RepName, those are counted separated and on other graph they are aggregated together.

Without knowing more about your data and business rules,I can´t help you more than this:

sum(aggr(sum({<WeekDate={41530}>}distinct CB_Units)/DailyDoseConvFactor,RepName))

in first graph will fix your values, please check if is what you need

View solution in original post

13 Replies
Not applicable
Author

is there any way to write this expression with out using distinct function

RangeSum((sum({<Week={12}>}Vol)/2),sum({<Week={12}>}DISTINCT Units)/2)

Not applicable
Author

can anyone help me on this

thanks in advance

Clever_Anjos
Employee
Employee

Could you post a sample app?

I´ll write the expression for you

v_iyyappan
Specialist
Specialist

Hi,

Dont use sum with distinct function. its not meaningful. If i understand correct means use like this

= (Sum({<Week={12}>}Vol)/2) +  (Count({<Week={12}>}DISTINCT Units)/2)

Regards,

Not applicable
Author

may i know where can i attach the file

Not applicable
Author

thanks for the response but it is not working

Clever_Anjos
Employee
Employee

Which expression? The last one?

Not applicable
Author

if you see the totals for 9/13/2013 in chart one CB Data is 120 since i am using distinct

and in the second chart CB data value is 210 since i apply distinct but there i am using sum of rows

Clever_Anjos
Employee
Employee

Find the "problem":

The expression shows different values because  "Mary Herrera" and "Rebecca O'Marrah" have same CB_UNITS, so when your graph splits by RepName, those are counted separated and on other graph they are aggregated together.

Without knowing more about your data and business rules,I can´t help you more than this:

sum(aggr(sum({<WeekDate={41530}>}distinct CB_Units)/DailyDoseConvFactor,RepName))

in first graph will fix your values, please check if is what you need