Skip to main content
Announcements
The way to achieve your own success is the willingness to help somebody else. Go for it!
cancel
Showing results for 
Search instead for 
Did you mean: 
sushovan93
Contributor III
Contributor III

load distinct value from database!

Hi

I have a data like

      

IDNameVendorSub ContractorRoleHours Shift
348765Sovan,MandalDEFABCXYZ12.2NS
348765Shovan,MandalDEFABCXYZ12.2

NS

in HANA table, how can i load only one data into my QlikView QVD?

I need to load only

348765Shovan,MandalDEFABCXYZ12.2NS

Please any one help me with this,

Thanks in advance for the help.

i tried:

SQL: Select distinct(ID),

name,.....,

from table.

Unfortunately it did not work.

4 Replies
juraj_misina
Luminary Alumni
Luminary Alumni

Hi,

I can't advise on SQL, but I can advise on Qlik and what you can do is

LOAD

ID,

FirstSortedValue(Name) as Name,

Vendor,

...

Group By

ID,

Vendor,

...

;

SQL Select * from table;

Unfortunately, there's no function such as ChooseCorrectValueFromThisPileOfRandomCrap(FieldName) so you might not get THE value, but you will only get one distinct record.

Hope this helps

Juraj

a_mullick
Creator III
Creator III

Hi,

If the rows are exactly the same, then DISTINCT should work fine. Perhaps try without the brackets around 'ID'.

Here's a tutorial:

https://www.w3resource.com/sql/select-statement/queries-with-distinct-multiple-columns.php

Thanks,

Azam

sushovan93
Contributor III
Contributor III
Author

Hi Azam,

Thanks for the help,

I tried with distinct, with and without the bracket.

but it did not work.

Thank you very much

a_mullick
Creator III
Creator III

That suggests that the rows are unique then. Looking at the example you posted, I notice that the first line has 'Sovan', and the 2nd has 'Shovan' in the name field. I know that the example may not be real data, but a DISTINCT would 'fail' in that query.

Azam