Skip to main content
Announcements
Customer Spotlight: Discover what’s possible with embedded analytics Oct. 16 at 10:00 AM ET: REGISTER NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Problem with min and max count using set analysis

Hi

Can anyone help?

I'm trying to display the min count and also the max count of items in column B on any one day.  I have tried the aggr function and group by in script but to no avail.

Date               B

01/01/2014     ABC

01/01/2014     BDC

01/01/2014     DEF

02/01/2014     CAD

02/01/2014     ABC

03/01/2014     ABC

The result that I'm after is min = 1 and max = 3

I'm sure it must be something really simple that I'm missing here?

Any help would be much appreciated.

Thanks

1 Solution

Accepted Solutions
maxgro
MVP
MVP

in a text box

'Min = ' & min(aggr(count(distinct B),Date))

&  chr(10) &

'Max = ' & max(aggr(count(distinct B),Date))

View solution in original post

5 Replies
its_anandrjs

To find min = 1 and max = 3 on column B

freq:

LOAD * Inline

[

Date,           B

01/01/2014,     ABC

01/01/2014,     BDC

01/01/2014,     DEF

02/01/2014,     CAD

02/01/2014,     ABC

03/01/2014,     ABC

];

NoConcatenate

MaxMinFind:

LOAD

B as Bid,

Count(B) as Freq

Resident freq

Group By B

Order by B asc;

Let vMax = Peek('Freq',0,'MaxMinFind');

Let vMin = Peek('Freq',-1,'MaxMinFind');

DROP Table MaxMinFind;

And plot two text box and display Max and Min values like

=vMin and =vMax

chiru_thota
Specialist
Specialist

You can do it with the help of variables.

See attached QVW.

min and max.jpg

maxgro
MVP
MVP

in a text box

'Min = ' & min(aggr(count(distinct B),Date))

&  chr(10) &

'Max = ' & max(aggr(count(distinct B),Date))

Not applicable
Author

This worked well. Thank you

Not applicable
Author

This works well - thank you for your help