Qlik Community

QlikView Creating Analytics

Discussion Board for collaboration related to Creating Analytics for QlikView.

Announcements
Announcement: Certain actions are currently causing a Page Not Found error. This is a known issue and we are working with the platform vendor to investigate and resolve it.
Highlighted
samvile18
Contributor II

Can someone please help?

I have the following script which joins a couple of tables by UniqueKey, what I now want to do is create an additional field based on the newly created table. I can get it to work but the data is growing when I don't believe is should be, can anyone suggest what I'm doing wrong...or maybe a better way of doing it?

AWDCombined:

LOAD UniqueKey,

     SchemeNo

FROM [Combined.qvd]

Left Join (AWDCombined)

LOAD UniqueKey,

     NGSSchemeNo;

SQL SELECT *

FROM FPWFI;

Left Join (AWDCombined)

LOAD UniqueKey,

     if(Len(SchemeNo)>6,NGSSchemeNo,SchemeNo) as RealSchemeNo

Resident AWDCombined;

Like I say, the above does work, it just seems to cause the underlying data to grow and I don't know why.

3 Replies
manideep78
Valued Contributor

Re: Can someone please help?

Tryt this,

AWDCombined:

LOAD *, if(Len(SchemeNo)>6,NGSSchemeNo,SchemeNo) as RealSchemeNo;

LOAD UniqueKey,

     SchemeNo

FROM [Combined.qvd]

Left Join (AWDCombined)

LOAD UniqueKey,

     NGSSchemeNo;

SQL SELECT *

FROM FPWFI;

MVP
MVP

Re: Can someone please help?

the data grow? is the UniqueKey really unique (in qvd and in db)?

preminqlik
Valued Contributor II

Re: Can someone please help?

try this  : use distinct

AWDCombined:

LOAD distinct UniqueKey,

     SchemeNo

FROM [Combined.qvd]

Left Join (AWDCombined)

LOAD distinct UniqueKey,

     NGSSchemeNo;

SQL SELECT *

FROM FPWFI;

Left Join (AWDCombined)

LOAD distinct UniqueKey,

     if(Len(SchemeNo)>6,NGSSchemeNo,SchemeNo) as RealSchemeNo

Resident AWDCombined;