Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Sum Values Only Once

Dear all,

In advance, thanks for all the comments that you may provide. Here is my situation.

I have this set of values as can be seen in attachment named Foto1

error loading image

As you can see, for a single brick the values get exactly repeated by each territory calling them. What I'm trying to do is to only sum then once, because if I sum then directly then the values might get duplicated. I've been working around with sum and aggr but no good results came from that.

Guys, any ideas?

Again thanks for your help.

Regards,

Andrés A. Jején P.

10 Replies
Not applicable
Author

u will do sum() group by treatry id

Not applicable
Author

Hi

Not that I would know - but are you sure that this is the correct data you have to work with and duplication is not itself the issue?

I all your territories use the same bricks you can conditionaly sum on one of the territories,

vT = min(territory)

sum (if (territory = vT, [Sold Units]))

Regards

Juerg

Not applicable
Author

Hi Juerg,

In fact I'm positive that the data is correct, many territories may call the same brick (sales territory). What I'm trying to do is to extract a national total, by sum the brick value only once no matter if it is called by only one or by several territories.

Thanks for your answer!

Not applicable
Author

Hi Ashish,

In fact, What I'm trying to do is to perform the sum but avoiding to take into account the territory_id.

Thanks!

Not applicable
Author

Have you tried Sum(DISTINCT Sold_Units)?

Not applicable
Author

Hi Aaron,

Yes, but it will sum the distinct numeric values available in the table, and that's not what I want to do. What I want is to sum the values for all the distinct bricks only once, regardless that is being seen in more than one territory.

Thanks for your answer!

Not applicable
Author

Hi Andres

still not sure I understood your expected result. Would a distinct list of brick_id, product_id and [Sold Units] give you this result?

Juerg

Not applicable
Author

Hi Juerg,

Yes, that is the result that I need, but I can't accomplish that on the data level since I have another analysis that will use the territory level for its purposes. What I need is to analyse this data set only by brick and to sum the values only once.

Thanks a lot for your answer.

Not applicable
Author

In the example at the beginning, are you wanting the sum of the Sold_Units to appear only once at the bottom or do you want it repeated for each territory?