Skip to main content
Announcements
Qlik Connect 2025: 3 days of full immersion in data, analytics, and AI. May 13-15 | Orlando, FL: Learn More
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Tricky aggregation question

Hello QV Community -

I'm stuck on this question:  I have a table with four columns:  Date, Time, Market and Station.  I want to display a text box showing the count of rows where there is just 1 station when grouped by Date&Time&Market.

For example, if my Date, Time, Market, Station data is this ...

DateTimeMarketStation
2015-03-011000

Dallas

WFAA
2015-03-021000DallasWUSA
2015-03-031100DallasWFAA
2015-03-031100ChicagoWBBM
2015-03-031100ChicagoWMAQ
2015-03-031100ChicagoWLS
2015-03-030900PortlandKYW

... the expected count would be 2 (the bold rows).

Thank you.

1 Solution

Accepted Solutions
Not applicable
Author

Try Like Below:

Sum(IF(Aggr(Count(Distinct Station),Date,Time,Market) = 1 , 1, 0))

View solution in original post

4 Replies
Not applicable
Author

Try Like Below:

Sum(IF(Aggr(Count(Distinct Station),Date,Time,Market) = 1 , 1, 0))

swuehl
MVP
MVP

Not sure I understand your analysis, what about rows 1 and 2?

Not applicable
Author

As per your description, you should get 4 Rows and those are 1,2,3,7

MarcoWedel

-Sum(Aggr(Count(Distinct Station)=1,Date,Time,Market))

QlikCommunity_Thread_210865_Pic1.JPG

hope this helps

regards

Marco