Skip to main content
Announcements
See why Qlik is a Leader in the 2024 Gartner® Magic Quadrant™ for Analytics & BI Platforms. Download Now
cancel
Showing results for 
Search instead for 
Did you mean: 
Fquiroga95
Contributor II
Contributor II

Number of records in straight table, aggregated by certain columns

Hi, I would like to obtain the number of records of a table in a specific column, aggregated by week and segment.

This means for example, For week 2, Lower Midmarket segment, I have 4 records.

Week 2 for Small Business I have 3 records. And they must be in a column.

Fquiroga95_0-1662128594924.png

 

I am trying with


AGGR(NODISTINCT
NoOfRows(),Week,Segment)

 

But is not working, its giving wrong numbers.

 

I also tried with:

 

AGGR(NODISTINCT
Count(Vendor),Week,Segment) // in order to count another field, but it doesn't work either. 

 

4 Replies
rwunderlich
Partner Ambassador/MVP
Partner Ambassador/MVP

Assuming Week and Segment are columns in your straight table, try 

Count(Total<Week, Segment> Vendor)

-Rob

Aurelien_Martinez
Partner - Specialist II
Partner - Specialist II

Hi,

Perhaps with TOTAL

Count(TOTAL <Week, Segment> Vendor)

Help users find answers! Don't forget to mark a solution that worked for you!
Fquiroga95
Contributor II
Contributor II
Author

Thanks for your answer, anyway Its giving me the same result..

So this should be flexible depending the columns I put in the table. Maybe there are more "Vendor" records associated to a certain week and segment that I am seeing in the table ? Not all the data comes from the same table... I need the exact number of records the table is displaying.

rwunderlich
Partner Ambassador/MVP
Partner Ambassador/MVP

If you want to count the number of displayed rows -- which is the number of dimension combinations --  do it like this:

Count(Distinct TOTAL <Week, Segment> Week & Segment)

-Rob