Qlik Community

QlikView Layout & Visualizations

Discussion Board for collaboration on QlikView Layout & Visualizations.

sqlpuzzle
New Contributor II

Expression to Get Count with a condition

AccountIdCountry
1USA
2USA
3USA
4USA
5USA
6USA
7USA
8USA
2CAN
2CAN
3CAN
4CAN
6CAN
6CAN
5USA
9CAN

Hello,

In a sample scenario I have the above table.

AccountId's in both Countries are 2,3,4,6.

I need an expression that would count the distinct AccountId's that exist in both countries.

In this case I am expecting 4 as four of them (2,3,4,6 exists in both countries)

How can I get this done?

Tags (1)
1 Solution

Accepted Solutions
antoniotiman
Honored Contributor III

Re: Expression to Get Count with a condition

Hi Joe,

=Count({<AccountId={'=Count(DISTINCT Country) > 1'}>} DISTINCT AccountId)    ->  4

=Concat({<AccountId={'=Count(DISTINCT Country) > 1'}>} DISTINCT AccountId,';')  ->   2;3;4;6

Regards,

Antonio

1 Reply
antoniotiman
Honored Contributor III

Re: Expression to Get Count with a condition

Hi Joe,

=Count({<AccountId={'=Count(DISTINCT Country) > 1'}>} DISTINCT AccountId)    ->  4

=Concat({<AccountId={'=Count(DISTINCT Country) > 1'}>} DISTINCT AccountId,';')  ->   2;3;4;6

Regards,

Antonio

Community Browser