Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Pivot Table: Sum of Rows?

Hello,

I have a Pivot Table where there is something like this:

PRODUCTACCOUNTCOUNT
001101
001201
002301
002401
003301
004401
004501
5

But if I contract all, I see:

PRODUCTCOUNT
001       +2
002       +2
003       +1
004      +2
5

Where:

- Product: Dimension

- Account: Dimension

- Count: Expression

The Expression Count is this:

COUNT (DISTINCT ACCOUNT)

So it counts the distinct accounts for every product

That's why it shows me 5 instead of 7...

I'd like to show the value as a Sum of Rows (like in Simple Table, but I need to use this Pivot Table), in order to show me 7.

Do you know how could I do this?

Thank you!

2 Replies
er_mohit
Master II
Master II

Try this expression

Count(TOTAL <PRODUCT> ACCOUNT)

PrashantSangle

Hi,

When you are using DISTINCT , It will give you count of only Distinct Account which is in your case

10,20,30,40,50

Therefore it is showing you Count =5,

If you want to Count of All account even if they are repeated then try with

Simple count(ACCOUNT) instead of trying with count(distinct ACCOUNT).

Or you can try with Aggr() also,

Like,

AGGR(count(distinct ACCOUNT),PRODUCT)

Regards,

Great dreamer's dreams never fulfilled, they are always transcended.
Please appreciate our Qlik community members by giving Kudos for sharing their time for your query. If your query is answered, please mark the topic as resolved 🙂