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

Announcements
Join us to spark ideas for how to put the latest capabilities into action. Register here!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Calling two tables in the script

Hello,

I run a binary load to pull multiple tables in QV. In the script (after the binary) I want to create a feild that looks at the "SalesPersonName" feild and if it equals a certain name I want the output to be "OrderCreateName". Otherwise I want "SalesPersonName" as the output. SalesPersonName and OrderCreateName are on two separate tables. Here is the current script I am trying with out any luck. Any suggestions would be great!

Load

          *,

          if(SalesPersonName='Smith, Jeff' ,OrderCreateName,SalesPersonName) as Name_Master

          Resident dimSales;

Thanks!!

3 Replies
rwunderlich
Partner Ambassador/MVP
Partner Ambassador/MVP

What links dimSales to the table that contains OrderCreateName? Is there a field in common like "OrderId"?

-Rob

Not applicable
Author

Hi Rob,

Thanks for your response. SalesPersonName and OrderCreateName are actually on opposite ends of a star schema. There are two tables in between them. I have attached a diagram. I appreciate any insight. Thanks!SalesPersonName to OrderCreateName.jpg

Not applicable
Author

Is there any way to do this as a calculated demension?

For example


Aggr( if( SalesPersonName='Smith, Jeff' ,OrderCreateName,SalesPersonName),SalesPersonName

Thanks