Skip to main content
Announcements
Introducing a new Enhanced File Management feature in Qlik Cloud! GET THE DETAILS!
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

AGGR function issue

Hello All,

I have below data sets

TerritoryUserSales
E0SNDP10.56
E0SNDP
E1NPD12
E1NPD11
E1NPD13

I need to show Sales Territory wise

Chart Format

TerritorySales
E010.56
E136

But internally, it should show data according to user,

If I use Aggr, it shows Data for small data set like above correctly, but if i take large dataset and multiple other relevant columns, then chart shows incorrect data for those territoies where null Sales are present. Overall Sales display null which should not happen.

Regards,

Nita Prasad

1 Solution

Accepted Solutions
Anonymous
Not applicable
Author

Hello All,

I finally understood, where I was doing mistake.

I need to show territory wise average, min , max sale .. for all the sales person.

I should have kept Territory explicitely in the expression, that should have solved my problem.

aggr( sum(Sales),User,Territory))

It solved my problem.

Thanks both of you, for taking time out to understand my requirement.

Thanks and Regards,

Nita Prasad

View solution in original post

8 Replies
MK_QSL
MVP
MVP

Create a straight table

Dimension

Territory

Expression

SUM(Sales)

Anonymous
Not applicable
Author

Thanks Manish.

Yes I have created the straight Table. In the expression, I need to sum data according to user... like we do in pivot table.

(aggr(If(Sum(Sales)=0,null(), sum(Sales)),User))

It works fine for this small data set, but for complex data set where multiple users have null date, plus some data for different time, in that case my expression return null.

Regards,

Nita Prasad

MK_QSL
MVP
MVP

Sorry but not understood your question properly.... Provide some more information along with sample or dummy data and expecting result...

giakoum
Partner - Master II
Partner - Master II

what is the use of the if statement? this should be enough :

Rangesum(aggr(sum(Sales),User))

Anonymous
Not applicable
Author

Hello All,

Hopefully, you can understand more clearly what issue I am facing? I have attached sample file with this reply.

Thanks and Regards,

Nita Prasad@

giakoum
Partner - Master II
Partner - Master II

Sum of rows in the expression tab

MK_QSL
MVP
MVP

What you want to get as an output... i.e. what is the logic behind using below expression

rangesum(aggr( sum(Sales),User))

Anonymous
Not applicable
Author

Hello All,

I finally understood, where I was doing mistake.

I need to show territory wise average, min , max sale .. for all the sales person.

I should have kept Territory explicitely in the expression, that should have solved my problem.

aggr( sum(Sales),User,Territory))

It solved my problem.

Thanks both of you, for taking time out to understand my requirement.

Thanks and Regards,

Nita Prasad