load * from I:\Statistics\QVA\Datafiles\2012\StatKomp2012_gen.qvd (qvd);
load * from I:\Statisticsk\QVA\Datafiles\2013\StatKomp2013_gen.qvd (qvd);
join load cunumber,Salesman1 as CR_Sales1,Salesman2 as CR_Sales2 resident Customer_read;
This gives me both salesmen in every record but I will have only the one that correspod
to the inoice type in inv_type
In my earlier script where I was joining the salesman in an temptable
Load [@1:8T] as inv_period1,
from I:\Statistics\QVA\Datafiles\2012\stat12_gen.txt (ansi, fix, no labels, header is 0, record is line)
join load cunumber,Salesman1,Salesman2 resident Customer_read;
and in the next read I had an if-sentence
Load inv_period1 as inv_period,
inv_type1 as inv_type,
if(inv_type1='L',Salesman1,Salesman2) as inv_salesman
where left(StatHierarki1,2)<>'17' ;
This inv_salesman was then used in an Load * Inline
Load * Inline [
SE999900, No allocation
SE999905, No allocation
' ', No allocation
When I load the qvd-files I have no connection to the field inv_type as I have when I load
from the txt-file.
Is there any other way to put the right salesman to the record in the table Invoices?
thanks for the response but I dont get the salesman number into the field 'Invoice_Salesman' though the ''No salesman 1' not is the value of Salesman1 in the mapping. If I use it as it is now I only get the text 'Salesman1' or
'Salesman2' . How do I get the values from Salesman1 and Salesman2 into Invoice_SalesMan?
Note that if you ever want to publish this document on a QlikView server, you should replace the QVD paths with corresponding UNC paths. Drive I: almost certainly won't exist for the service account on a QlikView Server.
Even better, store the path(s) in variables at the front of your script and use the variables throughout your tabs. Makes maintenance a lot easier when locations change.