Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
krishna20
Specialist II
Specialist II

Duplicate values in field.

Hi Folks,

I am having junk values in a filed like below. There is a special characters included  and the value is repeating n times.

¤IS North America;¤IS North America;¤IS North America
¤North America;¤North America;¤North America

¤One IS Office;¤One IS Office;¤One IS Office

Please suggest me to restrict the junk values and to show only single value in the field .

Like

      IS North America

       North America

       One IS Office

Thanks

krishna

9 Replies
Gysbert_Wassenaar
Partner - Champion III
Partner - Champion III

Perhaps like this:

subfield( KeepChar(Field_With_Junk, 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890 ;'), ';', 1)


talk is cheap, supply exceeds demand
Anonymous
Not applicable

if all values belong to same scheme you may use (use fieldname instead of text)

=purgechar(SubField('¤IS North America;¤IS North America;¤IS North America',';',1),'¤')

krishna20
Specialist II
Specialist II
Author

Hi Gysbert,

Thank you for your valuable reply. It's not working as you suggested.

My code is

A :

.............

Units L

.............

...........

.........................

left join (A)

LOAD ID,

  concat(subfield( KeepChar([Units L], 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890 ;'), ';', 1),';') as [Units L1]

Resident A

Group By ID;

Gysbert_Wassenaar
Partner - Champion III
Partner - Champion III

A :

.............

Units L

.............

...........

.........................

That doesn't look like a valid load statement to me. So I wouldn't expect that to work.


talk is cheap, supply exceeds demand
beck_bakytbek
Master
Master

Hi Kalyan,

check this: Duplicates on multiple Excel Loads

i hope that resolves your issue

beck

krishna20
Specialist II
Specialist II
Author

Hi Gysbert,

............... it means that there is some fields in the table.

Please find the below script

A:

LOAD

        [ YearMonth],

        [Id ] as ID,

     [ Units L1],

   [ Units L1 Id],

    [Units L2],

      [Units L2 Id],

    [ Units L3],

   [  Units L3 Id],

    [ Units L4],

    [ Units L4 Id],

    [ Units L5],

  [ Units L5 Id]

FROM $(vQVD)\X.qvd

(qvd);

left join (A)

LOAD ID,

  concat(subfield( KeepChar([Units L], 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890 ;'), ';', 1),';') as [Units L1]

Resident A

Group By ID;

Gysbert_Wassenaar
Partner - Champion III
Partner - Champion III

Can you post that X.qvd file. Or if it's a very big file then a small representative subset of it?


talk is cheap, supply exceeds demand
Anil_Babu_Samineni

KALYAN KRISHNA wrote:

A:

LOAD

      [ YearMonth],

        [Id ] as ID,

    [ Units L1],

  [ Units L1 Id],

    [Units L2],

      [Units L2 Id],

    [ Units L3],

  [  Units L3 Id],

    [ Units L4],

    [ Units L4 Id],

    [ Units L5],

  [ Units L5 Id]

FROM $(vQVD)\X.qvd

(qvd);

left join (A)

LOAD ID,

  concat(subfield( KeepChar([Units L], 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890 ;'), ';', 1),';') as [Units L1]

Resident A

Group By ID;

I am not seeing any more the [Units L] Field

concat(subfield( KeepChar([Units L], 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890 ;'), ';', 1),';') as [Units L1]

Does It you are facing Issue

Then Figure out where do you vi-sibling that Field

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
wallerjc
Partner - Contributor III
Partner - Contributor III