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, Aggr- help needed

!Hello,

creating a pivot table with 2 dimensions (Dim1 and Dim2) and trying to create an expression where

it should be like

Aggr(count( Total Distinct [FieldA]),Dim1) - the aggr needs to be calculated on Dim1 only but the pivot table has Dim2 which shouldn't be included in calculating the expression.

Thanks.

1 Solution

Accepted Solutions
sunny_talwar

This?

Capture.PNG

Count(DISTINCT TOTAL <Dim1> FAC_NUM)

View solution in original post

15 Replies
sunny_talwar

Try this:

Count(TOTAL <Dim1> [FieldA])

Not applicable
Author

I knew i would get the right help here!

But, i realized that my question needs to be more accurate for the right help.

When i tried with your solution it gave me a (19+21)40 across all thru REMC and RMCSE.

Please find the table to provide more  idea on the post that i am looking to achieve.

Thanks.

sunny_talwar

Table? Did you attach something?

Not applicable
Author

Sorry,For some reason it didn't show up earlier, just re posted again.

sunny_talwar

I still think you can do this using this:

Count(TOTAL <Dim1> [FieldA])

Is this not working?

Not applicable
Author

With the Count(TOTAL <Dim1> [FieldA]),


I am getting a value 40 across Dim1-REMC and RMCSE.


But the anticipation is that it should be 19 for REMC across and 21 for RMCSE across.

 

Dim1Dim2Exp1
REMCN/s 1c240
REMCRWD40
REMCTESC40
RMCSENS 2.140
RMCSERC 1.240
RMCSEN/s 1c240
sunny_talwar

You have Both Dim1 and Dim2 as dimensions right and not just Dim2? If you have just Dim2 as dimension, then try this:

Sum(Aggr(Count(TOTAL <Dim1> [FieldA]), Dim1, Dim2))

Not applicable
Author

Hello Sunny,

There are Dim1 and Dim2 as dimensions in the pivot table and if try the expression created it does the aggr but again shows the aggr of overall Dim1 but need a dim1 values RMCSE and REMC.

looking for a which will show in the exp across for all Dim1 REMC it should 19 only same with the RMCSE it should be 21 static for all Dim2 values.

working on creating an example qvw that i can post for more info.

Thanks.

sunny_talwar

For demonstration created a sample. Check it out:

Capture.PNG

NOTE: Used Sum instead of Count, but you might need Count.