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

Announcements
Save $650 on Qlik Connect, Dec 1 - 7, our lowest price of the year. Register with code CYBERWEEK: Register
cancel
Showing results for 
Search instead for 
Did you mean: 
Ramu_i
Creator II
Creator II

How to get count >2 ID's

Hi All,

I have table 

ID Country
1 AUS
2 AUS
3 AUS
4 IND
5 IND
6 US
7 UK
8 Japan
9 AUS
10 IND

 

How to find the country wise >2  id's of country

AUS  4

IND 3

US 1

UK 1

Japan 1

 

Required out put is :

getting only AUS and IND data in script side, Remaining data remove , How will do.

 

Thanks Advance

Ram

 

5 Replies
anat
Master
Master

test:
load * Inline [
ID,Country
1,AUS
2,AUS
3,AUS
4,IND
5,IND
6,US
7,UK
8,Japan
9,AUS
10,IND

];

NoConcatenate

LOAD * Where Cnt>2;
LOAD Country,count(Country) as Cnt Resident test group by Country;

DROP Table test;

brunobertels
Master
Master

hi 

 

try this 

[Table]:
load *,
'1' as CountID;

LOAD * INLINE
[
ID,Country
1,AUS
2,AUS
3,AUS
4,IND
5,IND
6,US
7,UK
8,Japan
9,AUS
10,IND
](delimiter is ',');

final:
load * where CountID >=2;
Load
sum( CountID) as CountID ,
Country
Resident Table group by Country ;
drop table Table;

Ramu_i
Creator II
Creator II
Author

Hi Anat,

Here Id is the EMP Id , We need Id also.

Country   ID

AUS    1

AUS    2

AUS   3

AUS   9

IND    4

IND   5

IND  10

 

This is out put required

 

Thanks advance

Ram

anat
Master
Master

LOAD * INLINE
[
ID,Country
1,AUS
2,AUS
3,AUS
4,IND
5,IND
6,US
7,UK
8,Japan
9,AUS
10,IND
](delimiter is ',');

final:
load * where CountID >=2;
Load
sum( CountID) as CountID ,
Country
Resident Table group by Country ;

Ramu_i
Creator II
Creator II
Author

Hi Anat ,

We have other columns also there, we have emp details table.

requirement is country wise more than two employees are there , we need that information.

Id Country  Name Joindate Hike% ...

 

Thanks advance.

Ram