Discussion Board for collaboration related to QlikView App Development.
I have the below data and format of the expected results. I don't know the right expression to use to pull the expected results. Basically, I am just trying to get the full name linked to the usernames for the end users. May be ONLY function might be the solution but I am not getting how to write the expression. I get the expected results by twisting the sql script by adding multiple joins but I am sure QlikView has an easier expression to do this.
SELECT TableA.AccountID, TableB.Name
LEFT JOIN TableB
ON TableA. AttendingID =TableB. ProviderID AND TableA. AdmittingID =TableB.ProviderID
Expected Result - What expressions should I use to get the below result???
|1001||Walker, James||Trump, Peter|
|2001||Smith, Aliya||Walker, James|
|3001||Trump, Peter||Smith, Aliya|
Hi m w!
What you have done is divided TableA into Attending and Admitting tables and that is exactly what I meant by "I get the expected results by twisting the sql script by adding multiple joins". I am using straightbox so I was wondering if we can add some kind of expression that can solve this in a simpler way than doing much of coding in the script itself.
Expression to pick Name based on AttendingID and expression to pick Name based on AdmittingID.
I tried the below expressions in a StraightBox but it did not work.
Expression 1: IF(AttendingID=ProviderID, Name)
Expression 2: IF(AdmittingID=ProviderID, Name)
one solution could be:
Mapping LOAD * FROM [https://community.qlik.com/thread/220998] (html, codepage is 1252, embedded labels, table is @2);
ApplyMap('mapProvNam',AttendingID) as AttendingName,
ApplyMap('mapProvNam',AdmittingID) as AdmittingName
FROM [https://community.qlik.com/thread/220998] (html, codepage is 1252, embedded labels, table is @1);
hope this helps
I was just trying to not do this in the code script itself but as an expression. Thank you though for different solutions. Here is the logic that I am going to use for now with my actual code.
SELECT TableA.AccountID, TableB.Name as AttendingName, C.Name as AdmittingName
LEFT JOIN TableB
ON TableA.AttendingID =TableB.ProviderID
LEFT JOIN TableB as C
Thank you all!