Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Not applicable

Why can't i compare these two ?

Hey can somenoe help me pls, because i don't understand why

Unbenannt.png

8 Replies
MVP
MVP

Re: Why can't i compare these two ?

Hard to tell. Could you post some sample data?

Are you maybe missing a space between the single quotes? Or do you want to concatenate in other order:

Vorname & ' ' & Nachname

?

Or does your 'name' field is maybe called 'Name' in fact (Qv is case sensitive)?

Or does 'name' field contain another character instead of a simple space as separator?

edit: In general, can't see anything wrong:

LOAD *,

  if(Nachname & ' ' & Vorname = name,1,0) as Flag;

LOAD * INLINE [

Nachname, Vorname, name

Hans, Fritz, Hans Fritz

];

Not applicable

Re: Why can't i compare these two ?

Hi Hans, I think that you lost a space between the name and the first name.

So, try this:

if(Nachname & ' ' & Vorname = name,1,0)


I hope that it help you,


Regards,


Agustín



Not applicable

Re: Why can't i compare these two ?

Hey swuehl, i forgot to say that the fields "vorname" and "nachname" come from another exel file than the field "name".

Is the Problem maybe that they don't see each other ?

Unbenannt.png

MVP
MVP

Re: Why can't i compare these two ?

That could indeed be an issue. How are the tables linked in your data model?

bwisenosimenkg
Valued Contributor

Re: Why can't i compare these two ?

try to put trim() around vorname and nachname to make sure that noe extra spaces are present.
if(Trim(Nachname)&' '&Trim(Vorname) = Trim(name), 1 , 0)
Not applicable

Re: Why can't i compare these two ?

I thought i can just compare them over these attributes(name=nachname&vorname), they aren't really linked to each other.

If i need to link them before i can compare them, how do i make that? 

MVP
MVP

Re: Why can't i compare these two ?

How does your data model look like? You link tables by a common field name. If you are unsure how to do this, I would suggest that you do the free Qlik training courses you can access here

New to QlikView

or maybe have a look at

Video Link : 3483

Not applicable

Re: Why can't i compare these two ?

Without seeing your data, if you have "nachname" and "vorname" in one (first) table, and "name" in another (second), you could create a compound key in your first table, such as

Trim(nachname)&' '&Trim(vorname) As NameKey

and alias your name field in the second table e.g.

Load

..

Name,

Name as NameKey,

...

*;

Your tables would then be joined by NameKey.

Community Browser