Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi community,
I want Load 4 fields from a resident table. In this table i have ID_Employee, Name Employee, Function, UnityBussiness.
I want load this where ID_Employee must be distinct. Any ideas?
Thanks in advance
Best Regards
Bruno Paulo
One way is as below:
Source_Temp:
Load * Inline [
ID, Name, Function,Unity
1, Bruno,cooker,kitchen
1, Bruno,cooker,kitchen
2, Andrew,engineer,company
2, andrew,engineer,company
];
NoConcatenate
Final_Table:
Load *
Resident Source_Temp
Where Peek(ID) <> ID;
Drop Table Source_Temp;
Did you try like
Load DISTINCT ID_Employee, NameEmployee, Function, UityBusiness
FROM yourtablename;
yes, didnt work
Hi Bruno
Would you be able to share a sample with the expected output?
can you share some sample data to look into?
Hi,
You would expect the distinct to work if they are true duplications.
Is it the case that the other fields (Name Employee, Function, UnityBussiness) have different values in?
If that is the case then which instance would like to keep the first instance?
Mark
Try
LOAD
ID_Employee, FirstValue(NameEmployee) as NameEmployee,FirstValue( Function) as Function, FirstValue(UnityBusiness) as UnityBusiness
Resident Table
Group By ID_Employee;
Drop Table Table;
its hard to me to create sample but i can try explain
ID Name Function Unity
1 Bruno cooker kitchen
1 Bruno cooker kitchen
2 Andrew engineer company
2 andrew engineer company
I want to distinct load with base on id. Because some names, function and unity can repeat
I want
ID Name Function Unity
1 Bruno cooker kitchen
2 andrew engineer company
Hi
QlikView is case sensitive, so for your example Andrew and andrew are different, so for you load would be ignored by the Distince in the load. Maybe try cleaning the the data.
Something like
LOAD DISTINCT
Capitalize(TRIM(ID_Employee)) as ID_Employee,
Capitalize(TRIM(NameEmployee)) as NameEmployee,
Capitalize(TRIM(Function)) as Function,
Capitalize(TRIM(UityBusiness)) as UityBusiness
From....
One way is as below:
Source_Temp:
Load * Inline [
ID, Name, Function,Unity
1, Bruno,cooker,kitchen
1, Bruno,cooker,kitchen
2, Andrew,engineer,company
2, andrew,engineer,company
];
NoConcatenate
Final_Table:
Load *
Resident Source_Temp
Where Peek(ID) <> ID;
Drop Table Source_Temp;