Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
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
Hi,
Try this.
Load Name,Min(Priority) as Priority from xyz group by Name;
Regards,
Kaushik Solanki
See the attched application
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
Name | Min_Priotity |
Mark | 1 |
Goose | 2 |
Tom | 1 |
Henry | 3 |
Dvayne | 4 |
Sam | 2 |
see the attachement also