Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

associating data with "OR"

Hello Everyone,

I'm consolidating data from two different sources.

In one source I have the hours reported for certain type of actitivieties from people.

In the second source I have the hours reported for other types of actitivieties from the same people.

The name of people differs slightly, though people are the same and sometimes the same person has been assigned with 2 or 3 names.

So I did a mapping file where I created the correspondence between the names and the real people with rows like this:

- real person 1, name in source 1, name in source 2

- real person 1, another name in source 1, name in source 2

This does not work:

- qlikview complains for a loop

- an unwanted relation between activities has been created as a kind of filter, for a person now I see activities only when he/she did activities in the source 1 AND source 2.

What am I doing wrong??

   f.

1 Solution

Accepted Solutions
swuehl
MVP
MVP

You shouldn't get any loops at the end. Could you post your app or the relevant part of your scipt here?

The field "value" above is not really needed, but using the field and different values on each record (like a recno()), you could easily the resulting table (so I get unique records and all my records are shown e.g. in a table box.

But it should just indicate that there could be another one or more fields in the source table besides the Name.

The important thing in my example is the use of mapping tables and applymap, please refer also to the manual for that. You could also use only one mapping table instead of two, this will just hold all variations of names and the correlated real name.

Hope this helps,

Stefan

View solution in original post

4 Replies
swuehl
MVP
MVP

Hi,

are you using mapping load and applymap to map your Names?

Please look at this example, hope it helps:

Source1:

LOAD * INLINE [

NameS1, Value

Stephan, 10

];

Source2:

LOAD * INLINE [

NameS2, Value2

Steffan, 20

];

Map1:

mapping Load * INLINE [

NameS1, Real

Stephan, Stefan

];

Map2:

mapping Load * INLINE [

NameS2, Real

Steffan, Stefan

];

Load

ApplyMap('Map1', NameS1) as Name,

Value

resident Source1;

Load

ApplyMap('Map2', NameS2) as Name,

Value2 as Value

resident Source2;

drop Tables Source1, Source2;

Not applicable
Author

Hi swuehl,

swuehlthank you.

well,

that let me understand the insight of what's going on.

Result is the same I obtain a loop.

Is the "value" you add a sort of field added on purpose to avoid loops?

    f.

swuehl
MVP
MVP

You shouldn't get any loops at the end. Could you post your app or the relevant part of your scipt here?

The field "value" above is not really needed, but using the field and different values on each record (like a recno()), you could easily the resulting table (so I get unique records and all my records are shown e.g. in a table box.

But it should just indicate that there could be another one or more fields in the source table besides the Name.

The important thing in my example is the use of mapping tables and applymap, please refer also to the manual for that. You could also use only one mapping table instead of two, this will just hold all variations of names and the correlated real name.

Hope this helps,

Stefan

Not applicable
Author

Stefan,

actually there are other fields (which I did not individuate yet ) that were creating the loop.

Thank you!

    f.