Qlik Community

QlikView App Development

Discussion Board for collaboration related to QlikView App Development.

Announcements
If you are a Qlik Insight Bot user, join this collaborative group: JOIN GROUP
New Contributor II

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
Highlighted
Luminary
Luminary

Re: load distinct value from database!

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

Highlighted
Contributor III

Re: load distinct value from database!

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

Highlighted
New Contributor II

Re: load distinct value from database!

Hi Azam,

Thanks for the help,

I tried with distinct, with and without the bracket.

but it did not work.

Thank you very much

Highlighted
Contributor III

Re: load distinct value from database!

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