Skip to main content
Woohoo! Qlik Community has won “Best in Class Community” in the 2024 Khoros Kudos awards!
Announcements
Nov. 20th, Qlik Insider - Lakehouses: Driving the Future of Data & AI - PICK A SESSION
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

need help with Script

join (GlobalData)

load distinct Vendor,

upper(Vendor) as SAccess,

1 as All

Resident GlobalData;

join (GlobalData)

load distinct Vendor,

upper(left(Vendor, 4)) as SAccess ,

4 as All

Resident GlobalData;


join (GlobalData)

load distinct Vendor,

upper(left(Vendor,5)) as SAccess ,

5 as All

Resident GlobalData;

here when I take list box for All, I see only 1 is getting selected and the rest 4 & 5 were greyed out

john

11 Replies
MK_QSL
MVP
MVP

Provide data please !

Peter_Cammaert
Partner - Champion III
Partner - Champion III

That is because you cannot join the same fields over and over again to the same table. In this code, you try to create columns All and SAccess three times in a row. The first time you succeed, creating a column SAccess and a column All containing value 1 for all rows.

The second and third (ouiter) joins will try to use all fields as matching fields (because they all do exist in the table), producing no matches at all since the All field contains 1 all the time.

Maybe you'ld better explain what you plan to do?

Peter

Anonymous
Not applicable
Author

sure Peter, I have table  called globaldata, I' trying to apply section based on Vendor where 1 is to show everything , 4 and 5 is show limited data

john

MK_QSL
MVP
MVP

GlobalData:

Load * Inline

[

  Vendor

  ABCDE

  XYZMN

  PQRST

];

join (GlobalData)

Load Distinct Vendor, Upper(Vendor) as SAccess, 1 as All Resident GlobalData;

join (GlobalData)

Load Distinct Vendor, Upper(Left(Vendor,2)) as SAccess, 2 as All Resident GlobalData;

join (GlobalData)

Load Distinct Vendor, Upper(Left(Vendor,4)) as SAccess, 4 as All Resident GlobalData;

Gabriel
Partner - Specialist III
Partner - Specialist III

Hi,

Also you're doing OUTER JOIN is that what you wanted to do.

Why not LEFT JOIN?

Anonymous
Not applicable
Author

sorry Manish, this is same as what I have written in the original post. I'll be back with some data, I know its pretty hard to ask these things without data.

as peter suggested,  because of that outer  join i'm facing this issue, but I tried to perform Noconcatenate here but its throwing illegal combination of prefixes

john

MK_QSL
MVP
MVP

If you are joining, no need of noconcatenate.

I have provided script to show you that something wrong with your data or something being missed as my sample code is working..

Anonymous
Not applicable
Author

Thanks Manish, could you pls post the sample qvw file so that I'll look into that.

john

MK_QSL
MVP
MVP

I have provided whole sample script which I used.