Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Join us in Toronto Sept 9th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Mapping table with Section Access

I have the following code.

The "BinarySalesPerson.qvw" has the complete Employee table.

In the below code I am trying to implement section access. And based on the values from Section Application table (SECTAB) I am trying to create the Mapping table (Mapping_Table1).

I want to display all records from "BinarySalesPerson.qvw" for matching EID (based on Section Access) "Found" should be displayed else "Not Found" should be displayed.

The Section Access works prefect.

But for BinaryEMP table it always displays "Found" irrespective of Mapping.

Also, for the EID which are more than one value, it displays "Found" for first record and for rest of records '-'

Please suggest.

BINARY [BinarySalesPerson.qvw];

SET ThousandSep=',';

SET DecimalSep='.';

SET MoneyThousandSep=',';

SET MoneyDecimalSep='.';

SET MoneyFormat='Rs. #,##0.00;Rs. -#,##0.00';

SET TimeFormat='h:mm:ss TT';

SET DateFormat='DD/MM/YYYY';

SET TimestampFormat='DD/MM/YYYY h:mm:ss[.fff] TT';

SET MonthNames='Jan;Feb;Mar;Apr;May;Jun;Jul;Aug;Sep;Oct;Nov;Dec';

SET DayNames='Mon;Tue;Wed;Thu;Fri;Sat;Sun';

OLEDB CONNECT TO SQL CONNECTION String;

SECTION ACCESS; 

LOAD * INLINE [ 

ACCESS, USERID, EMPLOYEEID,OMIT

ADMIN, ADMIN 

USER, UK, 4,ShipRegion

USER, USA, 1,Shipregion

USER, USA, 3,Shipregion

USER, USA, 2,Shipregion 

]; 

SECTION APPLICATION; 

SECTAB:

SQL SELECT [OrderID]

      ,[CustomerID]

      ,[OrderDate]

      ,[EmployeeID] AS EMPLOYEEID

      ,[RequiredDate]

      ,[ShipRegion]

      ,[ShipPostalCode]

      ,'****' AS [Shipregion]

      ,UPPER([ShipCountry]) AS REGION

FROM Orders;

Mapping_Table1:

MAPPING LOAD Distinct

         EMPLOYEEID,

         'Found'

RESIDENT SECTAB;

BinaryEMP:

LOAD

      EID

      ,ApplyMap('Mapping_Table1', [EID],'Not Found') as  EMPLOYEEID_1

      ,[LastName]

      ,[FirstName]

      ,[Title]

Resident Employees;

3 Replies
Anil_Babu_Samineni

Remove Square Brackets and check / please post screen shot for en-count the error.

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
Anonymous
Not applicable
Author

I have attached the screen shot. In this I am using "UK" as login user.

The "SecTab_EMPLOYEEID" listbox and "SECTAB" table box shows the data with EmployeeID = 4 which is correct as per section access.

The "BinaryEMP" table box show all the data which is correct but in "EMPLOYEEID_1" column the data is displayed as "Found" for all the EID.

I want as for User "UK" only matching EID is 4, the value in "BinaryEMP" table box should display value "Found" for EID = 4 and for rest of them it should display "Not Found" under "EMPLOYEEID_1" column.

Anonymous
Not applicable
Author

Please suggest