Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

bthatcher
New Contributor

Linking a text import from a table back to the original table

I'm trying to split a column from a table to break the information down. When I use the script below it creats a new table containing the infomation I want. However it doesn't seem to link back to the original table.

Is there any way that I can either create a link between the two tables or recombine the two tables back into one?


LOAD SiteId,
    ItemId,
    ItemType,
    UserId,
    LocationType,
    Occurred,
    Year(Occurred) AS Year,
    Month(Occurred) AS Month,
    Event,
    EventSource,
    MachineName,
    MachineIp,
    DocLocation,
    EventName,
    SourceName,
    EventData;
SQL SELECT *
FROM "Portal21_Site".dbo.AuditData;


//****Split Doc Location********

LOAD
  @1,
     @2,
     @3,
     @4,
     @5,
     @6,
     @7,
     @8
    
    
FROM_FIELD
(AuditData, DocLocation)
(txt, utf8, no labels, delimiter is '/', msq);

1 Solution

Accepted Solutions
MVP
MVP

Re: Linking a text import from a table back to the original table

Hi

Qlikview "links" tables by means of fieldnames. As there are no common field names to the two tables, they will not be associated in any way. You can rename fields in the second table by

LOAD @1 As Key, .....

The usual design of a QV data model has a single key field common to the two tables. Multiple common fields will cause synthetic keys and/or data loops unless you join or concatenate the data.

In this case, it looks like you should join the data to the source table, but you will need to reconstruct the DocLocation in the second table, something like:

Join (AuditData)

LOAD @1 & If(Len(@2)>0, '/' & @2) & If(Len(@3)>0, '/' & @3) & .... & If(Len(@8)>0, '/' & @8) As DocLocation,

     @1,

     @2,

....

Hope that helps

Jonathan

Regards

Jonathan

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein
3 Replies
MVP
MVP

Re: Linking a text import from a table back to the original table

Hi

Qlikview "links" tables by means of fieldnames. As there are no common field names to the two tables, they will not be associated in any way. You can rename fields in the second table by

LOAD @1 As Key, .....

The usual design of a QV data model has a single key field common to the two tables. Multiple common fields will cause synthetic keys and/or data loops unless you join or concatenate the data.

In this case, it looks like you should join the data to the source table, but you will need to reconstruct the DocLocation in the second table, something like:

Join (AuditData)

LOAD @1 & If(Len(@2)>0, '/' & @2) & If(Len(@3)>0, '/' & @3) & .... & If(Len(@8)>0, '/' & @8) As DocLocation,

     @1,

     @2,

....

Hope that helps

Jonathan

Regards

Jonathan

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein
bthatcher
New Contributor

Re: Linking a text import from a table back to the original table

Thanks solved my problem,

bthatcher
New Contributor

Re: Linking a text import from a table back to the original table

Thanks solved my problem

Community Browser