Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
durgabhavani
Creator III
Creator III

Help me to get records based on indicator?

Hi,

Can you please help me to get records based on indicator.

We need to display the record if the indicator having value 1 if mulple records. if there is only one record with one indicator then we need to display the record whatever it is.

Please find the sample data and expected output below.

   

IDNameIndicator
101Hari1
102Sunil0
103Satish1
103Satish0
104Ramesh1
104Ramesh0
105Naresh1
106Venkat1
106Venkat0
106Venkat0
107Ravi0
108Raju0
108Raju0

 

Expected Output:

   

IDNameIndicator
101Hari1
102Sunil0
103Satish1
104Ramesh1
105Naresh1
106Venkat1
107Ravi0
108Raju0

Please advice.

Thanks in advance.

Durga

1 Solution

Accepted Solutions
neelamsaroha157
Specialist II
Specialist II

6 Replies
neelamsaroha157
Specialist II
Specialist II

Check this out.

tresesco
MVP
MVP

Capture.PNG

A front end solution:

Exp: =If( Aggr(Count(if(Indicator=1, Indicator)),ID)>0,Only({<Indicator={1}>}Indicator), Indicator)

Kushal_Chawda

May be

Data:

LOAD ID,

           Name,

           sum(distinct Indicator) as Indicator

FROM Source

Group by

          ID,

          Name;

sunny_talwar

for a chart based solution

Capture.PNG

durgabhavani
Creator III
Creator III
Author

Thank you All. Very useful solutions.

if there is null value in indicator. how to handle it?

is max(indicator) will work?.

neelamsaroha157
Specialist II
Specialist II

If there is only 1 records per ID with null Indicator then it would show null.

If there are multiple records fro 1 ID and one of them is null then it will pick up the max value.

If you want to treat null records separately then you can handle it with extra if condition like If(IsNull(Indicator), Condition, else condition).

Hope this helps.