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: 
nikhilgarg
Specialist II
Specialist II

Prob in Script

Hey,

I have script as:

Table1:

Load SalesPersonId;

Left Join

Table2:

LOAD SalesPersonId,

Region,

Salespersonname

LeftJoin

Table3:

LOAD SalesPersonId,

Desk;

Now i want those people that dont have region and desk it should come as 'Unknown' for both. How to acheive this?

Thanks

5 Replies
PrashantSangle

Hi,

Table1:

Load SalesPersonId;

Left Join

LOAD SalesPersonId,

Region,

Salespersonname

LeftJoin

LOAD SalesPersonId,

Desk;

final_Table:

Load *,

"Unknown" as Flag,

Resident Table1

where Isnull(Region) and Isnull(Desk);

concatenate

Load *,

"known" as Flag,

Resident Table1

where not Isnull(Region) and not Isnull(Desk);

drop table Table1;

Regards

Great dreamer's dreams never fulfilled, they are always transcended.
Please appreciate our Qlik community members by giving Kudos for sharing their time for your query. If your query is answered, please mark the topic as resolved 🙂
nikhilgarg
Specialist II
Specialist II
Author

Hey ,

Why u have used unknown and known as flag?

I want if salespersonid matching den values of region and desk should be

displayed if region and desk values not there den it should ahow unknown

only

awhitfield
Partner - Champion
Partner - Champion

Hi Nikhil

Table1:

Load SalesPersonId
FROM
[159247.xlsx]
(ooxml, embedded labels, table is Sheet1);

Left Join
  Table2:
  LOAD SalesPersonId,
if(Len(Region)=0,'Unknown',Region) as Region,
  Salespersonname
FROM
[159247.xlsx]
(ooxml, embedded labels, table is Sheet2);
  Left Join
  Table3:
  LOAD SalesPersonId,
If(Len(Desk)=0,'Unknown', Desk) as Desk
FROM
[159247.xlsx]
(ooxml, embedded labels, table is Sheet3);

Regards

Andy

PradeepReddy
Specialist II
Specialist II

Please check the attachment. It might be helpful.

maxgro
MVP
MVP

add this after your script

Table2:

NoConcatenate load

  SalesPersonId,

  if(IsNull(Region), 'unknown', Region) as Region,

  if(IsNull(Salespersonname), 'unknown', Salespersonname) as Salespersonname,

  if(IsNull(Desk), 'unknown', Desk) as Desk

Resident

  Table1;

DROP Table Table1;