Qlik Community

QlikView Creating Analytics

Discussion Board for collaboration related to Creating Analytics for QlikView.

Not applicable

Sum values based on a count in an expression

Hi,

With the following expression I simply count values based on some string values of the dimension data:

=count({$<data={'value a', 'value b'}>}profile.id)

However, I want to sum these two values in this expression and not through the 'expressions - Full Accummulation', or the 'Total Mode - sum of rows'.

I tried it with rangesum and aggr, but with no success. Can anyone help?

Thanks in advance!

1 Solution

Accepted Solutions

Re: Sum values based on a count in an expression

Maybe this:

sum(aggr(count({$<data={'value a', 'value b'}>}profile.id), MyChartDimension1, MyChartDimension2, ... etc ))

Replace MyChartDimension1, MyChartDimension2, ... etc with the names of the dimensions in your chart.

If that isn't what you need, see here and here.



talk is cheap, supply exceeds demand
3 Replies

Re: Sum values based on a count in an expression

Maybe this:

sum(aggr(count({$<data={'value a', 'value b'}>}profile.id), MyChartDimension1, MyChartDimension2, ... etc ))

Replace MyChartDimension1, MyChartDimension2, ... etc with the names of the dimensions in your chart.

If that isn't what you need, see here and here.



talk is cheap, supply exceeds demand
Not applicable

Re: Sum values based on a count in an expression

Thanks! I had tried this expression before too, but I forgot to remove the dimension data, so I always got two results and no accumulation.

Not applicable

Re: Sum values based on a count in an expression

Hey guys,

I find this discussion helpful and I seem to have a similar problem. Basically I need to find the SUM of all employees in a company that has offices in different countried. A country is represented by Country ID and each employee has an employee ID. I need to count all employees in each country and sum up all employees. here is my equition that is giving me an error

='No. of Emp = ' &count({< [Country ID] = {'CI-005'} >}  distinct [Emp ID]),  count({< [Country ID] = {'CI-008'} >}  distinct [Emp ID])

Can someone here help to tell me whats wrong?

Community Browser