Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
brunopaulo
Partner - Creator II
Partner - Creator II

Load Distinct

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

1 Solution

Accepted Solutions
trdandamudi
Master II
Master II

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;

View solution in original post

15 Replies
vishsaggi
Champion III
Champion III

Did you try like

Load DISTINCT ID_Employee, NameEmployee, Function, UityBusiness

FROM yourtablename;

brunopaulo
Partner - Creator II
Partner - Creator II
Author

yes, didnt work

el_aprendiz111
Specialist
Specialist

Hi Bruno

Would you be able to share a sample with the expected output?

vishsaggi
Champion III
Champion III

can you share some sample data to look into?

Mark_Little
Luminary
Luminary

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

antoniotiman
Master III
Master III

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;

brunopaulo
Partner - Creator II
Partner - Creator II
Author

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

Mark_Little
Luminary
Luminary

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....

trdandamudi
Master II
Master II

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;