Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
ruma_barman
Creator
Creator

To get the output on the basis of duplicate values of a field

Hi All,

I have a requirement to get the contract only those having more than one Asset

E.g  Input

Contract             Asset

11                         Asset 1
11                         Asset 2
22                         Asset 1
33                         360p
44                         Asset 1
44                        3037PS

Output:

Contract 

11

44

Thanks in advance,

Ruma

Labels (1)
2 Solutions

Accepted Solutions
StarinieriG
Partner - Specialist
Partner - Specialist

Try to use that as dimension =If(Aggr(Count(Asset),Contract)>1,Contract) and suppress null maybe

View solution in original post

StarinieriG
Partner - Specialist
Partner - Specialist

Maybe this

=Count({<Contract={"=Count(Asset)>= 2"}>}Asset)

or this

=Sum(If(Aggr(Count(Asset),Contract)>1,Aggr(Count(Asset),Contract)))

View solution in original post

7 Replies
StarinieriG
Partner - Specialist
Partner - Specialist

Hi,

maybe you could try in this way

 

LOAD
Contract
Where Count>1
;
Load
Contract,
Count(Asset) as Count

From ...
Group By
Contract;

ruma_barman
Creator
Creator
Author

Thanks for your reply.Can you suggest something on frontend using set analysis or something coz the datamodel is a bit complicated.

StarinieriG
Partner - Specialist
Partner - Specialist

Try to use that as dimension =If(Aggr(Count(Asset),Contract)>1,Contract) and suppress null maybe

ruma_barman
Creator
Creator
Author

Thanks for your solution . It worked. Can you tell if possible how to get the count of it .In this case it's 2.

StarinieriG
Partner - Specialist
Partner - Specialist

You could use Count(Asset) because in this way data are filtered by dimension

ruma_barman
Creator
Creator
Author

If in a KPI ,I want to show?

StarinieriG
Partner - Specialist
Partner - Specialist

Maybe this

=Count({<Contract={"=Count(Asset)>= 2"}>}Asset)

or this

=Sum(If(Aggr(Count(Asset),Contract)>1,Aggr(Count(Asset),Contract)))