Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I have an application where I need to link between sheets using a unique ID but linking to a sheet using a non-unique column.
See sample script below.
Using the Dual function, I'm able to link to another sheet when clicking on a non-unique column. My problem lies when I try to export
the data in Sheet1 to XLS, the column 'Type' is displaying the EmpID instead of the EmpType. Is there a way to have both functionality available - linking from one sheet to another using a unique ID but clicking on a non-unique column and have the XLS download displayed correctly ?
Thanks !
Employee:
LOAD
DUAL(EmpType, EmpID) as Type
, *;
LOAD * INLINE [
EmpID,EmpName,EmpType
10, Andy, Regular
11, Anthony, Regular
12, Bruce, Contractor
13, John, Contractor
];
Salary:
LOAD * INLINE [
EmpID,Salary
10,1000
11,2000
12,3000
13,4000
] ;
anyone ?
Hi,
What is the use of dual function in this scenario. This will work without dual function. Your code should be as follows.
Employee:
LOAD
EmpType as Type
, *;
LOAD * INLINE [
EmpID,EmpName,EmpType
10, Andy, Regular
11, Anthony, Regular
12, Bruce, Contractor
13, John, Contractor
];
Salary:
LOAD * INLINE [
EmpID,Salary
10,1000
11,2000
12,3000
13,4000
] ;
-Peterson
The use of dual is to pass a unique ID to the other sheet. By default, if you select EmpType='Regular' on row 1 (Andy), the result will display 2 rows -- Andy and Anthony. I need to only display Andy and not both. Similarly, if I click on EmpType='Contractor' on row 4 (John), the result should only display John and not both Bruce and John. I hope I explained it clearly now.
I`m not sure would this help you or not.
Can you create a dummy column like EmpType as Type_Display and use this for exporting and DUAL(EmpType, EmpID) as Type for selection.
-Peterson
Thanks Peterson. You gave me an idea here which leads me to my next question. Is there a way to display the EmpType in xls only, hiding it from the straight table while the Type need to be displayed in the straight table and hiding it from xls download ?
Again me to distrub you with one more idea for your question.
You can show the column in qlikview staright table and delete / hide same coulmn in xls using writting macros.
-Peterson