Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

How can i load data based on condition(filter) ?

Hi

I have the source data which having column ‘name’ and column ‘priority’. while loading, I only need to load data having lowest priority so that I can only get the distinct names with lowest priority. If suppose Mark having 1,2,3 priorities, output should be Mark , 1. Goose having 2,3,4 priorities, output should be 2. This I have to achieve at the backend level while loading data so the other priorities should not get load. Please help how it can be achieved at backend level while loading data?

Source data

Name

Priotity

Mark

1

Mark

2

Mark

3

Goose

2

Goose

3

Goose

4

Tom

1

Tom

4

Henry

3

Henry

4

Dvayne

4

Sam

2

Sam

4

Need to achieve Data after Loading

Name

Priotity

Mark

1

Goose

2

Tom

1

Henry

3

Dvayne

4

Sam

2

Thanks

Sarang

3 Replies
kaushiknsolanki
Partner Ambassador/MVP
Partner Ambassador/MVP

Hi,

     Try this.

     Load Name,Min(Priority) as Priority from xyz group by Name;

Regards,

Kaushik Solanki

Please remember to hit the 'Like' button and for helpful answers and resolutions, click on the 'Accept As Solution' button. Cheers!
Kushal_Chawda

See the attched application

er_mohit
Master II
Master II

Try this Code in Your Script

TestData:

LOAD * INLINE [

    Name, Priotity

    Mark, 1

    Mark, 2

    Mark, 3

    Goose, 2

    Goose, 3

    Goose, 4

    Tom, 1

    Tom, 4

    Henry, 3

    Henry, 4

    Dvayne, 4

    Sam, 2

    Sam, 4

];

Data:

LOAD Name,min(Priotity) as Min_Priotity

Resident TestData

Group by Name;

DROP Table TestData;

Take a Table Box

Output like this

NameMin_Priotity
Mark1
Goose2
Tom1
Henry3
Dvayne4
Sam2

see the attachement also