Skip to main content
Announcements
Qlik Community Office Hours - Bring your Ideation questions- May 15th, 11 AM ET: REGISTER NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
arusanah
Creator II
Creator II

lookup function not returning anything

Authorization:
Load
'User'as Access,
  upper(Group) as Group,
    Upper(GroupName) as GroupName,
    Upper(Group)&'\'&Upper(GroupName) as USERGROUP,
    objectCategory,
    objectClass,
    DistinguishedName,
    // subfield(subfield(DistinguishedName,'=',4),',',1)as Entity_Code,
     "cn" as UserID,
     Upper(Group)&'\'&Upper(GroupName)&'\'&"cn" as User,
    displayName as [Name]
FROM [lib://QVD/Raw\Active Directory\028_Raw_Active_Directory.qvd]
(qvd);

Trace 'Autorization Loaded';

NoConcatenate
Reduction:
Load * INLINE [
GROUP,   USERGROUP,       Entity_Code
    GRPA,     GROUP-A,  A
GRPB, GROUPBB ,  B
GRPC,  GROUP-C, C
];
Trace 'Reduction Loaded';

// Initating Entity
Let vEntity=Lookup('Entity_Code','GROUP',UserID,'Reduction');

2 Replies
adityaakshaya
Creator III
Creator III

Hi Archana,

You can't use lookup as mentioned. If you let me know what you are looking for as end result, I can help you to achieve it.

Regards,

Akshaya

arusanah
Creator II
Creator II
Author

Hi Akshaya ,

I am loading user/ Usergroup Info from a  qvd. . my requirement is to check if osuer() belongs to anyone of the usergroup that is coming from QVD . if yes the give him access to the entity which i am loading from inline table  .

I thought an error was in lookup(). which I changed and it was running fine. until I removed a comment from section access and section Application line and tried to reload app in QMC. it simply fails.... I fail to replicate issue as in Qlikview this works fine.  Qliksense throws tantrums. please help.

//Section Access;

Temp_Access

Load

'User'as Access,

  Group,

    GroupName,

    Upper(Group)&'\'&Upper(GroupName) as USERGROUP,

    objectCategory,

    objectClass,

    DistinguishedName,

    // subfield(subfield(DistinguishedName,'=',4),',',1)as Entity_Code,

     "cn" as UserID,

     Upper(Group)&'\'&Upper(GroupName)&'\'&"cn" as User,

    displayName as [Name]

FROM [lib://QVD/Raw\Active Directory\028_Raw_Active_Directory.qvd]

(qvd)  where Group='GrpB' or Group= 'GrpB';

Load

'Admin'as Access,

  Group,

    GroupName,

    Upper(Group)&'\'&Upper(GroupName) as USERGROUP,

    objectCategory,

    objectClass,

    DistinguishedName,

    // subfield(subfield(DistinguishedName,'=',4),',',1)as Entity_Code,

     "cn" as UserID,

     Upper(Group)&'\'&Upper(GroupName)&'\'&"cn" as User,

    displayName as [Name]

FROM [lib://QVD/Raw\Active Directory\028_Raw_Active_Directory.qvd]

(qvd) where Group='GrpA';

Authorization:

Load

          Access,

         Group,

         USERGROUP,

          UserID,

          User

Resident Temp_Access;

Drop  Table Temp_Access;

//Section Application;

inner join

Reduction:

Load * INLINE [

  USERGROUP,       Entity_Code

        GrpA\GROUP-A,  A

        GrpB\GROUP-B, B

        GrpC\GROUP-C,  C

];

Trace 'Autorization Loaded';

*************************** I replaced that witjh this new small piece of code and it works fine**********

let vUser= SubField( SubField(OSuser(),';',-1),'=',-1);

let vEntity = Lookup('Entity_Code','UserID',SubField( SubField(OSuser(),';',-1),'=',-1),'Reduction');

Trace '$(vUser)';

Trace '$(vEntity)';