Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
AWS Degraded - You may experience Community slowness, timeouts, or trouble accessing: LATEST HERE
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Multiple counts

Hi All,

My data is like this:

Data:

Load * inline [

AcctNo,Status

1,A

2,B

3,B

4,D

5,C

6,B

7,A

8,B] ;

I want to show

Count({<Status='A'>}AcctNo)

Count({<Status='B'>}AcctNo)

Count({<Status='C'>}AcctNo)

Count({<Status='D'>}AcctNo) Output like below dynamically in a text box.

2 A

4 B

1 C

1 D

How to achieve this?

Thanks in advance.

1 Solution

Accepted Solutions
sunny_talwar

May be this:

=Concat({<Status = {'*'}>} DISTINCT AGGR(Count({<Status = {'*'}>} TOTAL <Status> AcctNo) & ' ' & Status,Status), Chr(10))

View solution in original post

11 Replies
vinieme12
Champion III
Champion III

A Text box wouldn't be dynamic ! what exactly do you want to be dynamic?

=Count({<Status='A'>}AcctNo) & ' A' & chr(10) &

Count({<Status='B'>}AcctNo) & ' B' & chr(10) &

Count({<Status='C'>}AcctNo) & ' C' & chr(10) &

Count({<Status='D'>}AcctNo) & ' D'

Vineeth Pujari
If a post helps to resolve your issue, please accept it as a Solution.
vinieme12
Champion III
Champion III

try this in a text box

=Concat(DISTINCT AGGR(count(TOTAL <Status> AcctNo) & ' ' & Status,Status)

  , chr(10))

Vineeth Pujari
If a post helps to resolve your issue, please accept it as a Solution.
Not applicable
Author

Hi Vineeth, If Status is not there, it should be shown.

For example, Status D won't be available December month.How to make it dynamic?

vinieme12
Champion III
Champion III

try this in a text box

=Concat(DISTINCT AGGR(count(TOTAL <Status> AcctNo) & ' ' & Status,Status)

  , chr(10))

Vineeth Pujari
If a post helps to resolve your issue, please accept it as a Solution.
sunny_talwar

Although this might be a small typo, but you guys are missing  curly brackets in your set modifier

Capture.PNG

Besides what are we trying to achieve here?

Not applicable
Author

How to omit NULLs or '-'values of Status.

sunny_talwar

May be this:

=Concat({<Status = {'*'}>} DISTINCT AGGR(Count({<Status = {'*'}>} TOTAL <Status> AcctNo) & ' ' & Status,Status), Chr(10))

Not applicable
Author

Hi Sunny, Vineeth formula is working.

But how to omit NULL status as shown :

Load * inline [

AcctNo,Status

1,A

2,B

3,B

4,D

5,C

6,B

7,A

8,B

9,

10,

11,

12] ;

vinieme12
Champion III
Champion III

They don't have a status they won't be counted,

Have u tried?

Vineeth Pujari
If a post helps to resolve your issue, please accept it as a Solution.