Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Lookup() a concatenated field

Hi there

I have the below script. Currently, I am loading ''ref' into my mapping table. I would like to be able to load the concatenation of Project and Ref (Project&' '&ref as newref).

This does not work and I receive load errors,

Can anyone help?

Thanks

DependencyList:

LOAD ref, Dependent, [Target Date]

from (ooxml, embedded labels, table is [Risk]);

LOAD Project,

ref,

Project&' '&ref as newref,

Project&' '&Dependent as newdependency,

     [Risk Date Raised],

     [Raised by],

     Description,

     [Risk Owner],

     [Mitigation/ Contingency Actions],

     Probability,

     LOOKUP([Target Date], ref, Dependent, 'DependencyList') as Dependency1TargetDate,

     LOOKUP([Target Date], ref, LOOKUP(Dependent, ref, Dependent, 'DependencyList'), 'DependencyList') as Dependency2TargetDate,

     LOOKUP([Target Date], ref, LOOKUP(Dependent, ref, LOOKUP(Dependent, ref, Dependent, 'DependencyList'), 'DependencyList'),'DependencyList') as Dependency3TargetDate,

     [Impact Level],

     Status,

     Dependent,

     [Target Date],

     RAG

FROM

(ooxml, embedded labels, table is Risk);

22 Replies
Not applicable
Author

To clarify (sorry, not sure the above was clear),

I need to be able to use the mapping table & lookup to find the concat version of the field (Project&' '&ref as newref,)

settu_periasamy
Master III
Master III

Hi,

Can you post your Error?

Not applicable
Author

In the above script, there is no error, but when I add the concat fields to the lookup, I get the below

error.PNG

error2.PNG

settu_periasamy
Master III
Master III

May be try the same in the second table also..

LOOKUP([Target Date], Project&' '&ref, Dependent, 'DependencyList') as Dependency1TargetDate,

Not applicable
Author

I've tried the below:

This now throws no errors, but the script does not work as I'd expect it to - it doesn't seem to be using the mapping table values.

I need to be able to include 'as variableName' - and use that name in the lookup formula.

Is this possible?

newscript.PNG

settu_periasamy
Master III
Master III

Hi Kieran,

Can you provide the sample data with expected output?

Not applicable
Author

Hi there,

The expected output is the target date of the project thats been looked up.

E.G.

Ref   dependency   target date

1       2                   01/01/2016
2       3                   12/01/2016

The lookup should take the target date of the dependency. So when looking up ref 1, you should get the output date of 12/01/2016.

THis is working before I concat the fields

I've attached a sample excel below.

         

ProjectrefRisk Date RaisedRaised byDescriptionRisk OwnerMitigation/ Contingency ActionsProbabilityImpact LevelStatusDependentTarget DateRAG
5.1R127/05/2015Dave CTask 1 detailsDave CRisk Closed. Projects have not produeced PCR in time.
PCRs to be evaluated on a case by case basis. Any that impact time will be bought to SteerCo for evaluaiton
MedHighOpen 01/09/2019GREEN
5.1R227/05/2015Dave CTask2 detailsDave CEarly planning with the DAB 4.2 project to minimise disruptionLowHighOpenR101/01/2017GREEN
5.1R307/07/2015Pete MTask 3 detailsDave CRisk accepted. Escalation may be required to ensure project timescales are metMedHighOpenR201/01/2012GREEN
5.1R407/07/2015Pete MTask 4 detailsDave CRisk accepted. Escalation may be required to ensure project timescales are metMedHighOpenR301/01/2012AMBER
5.1R520/10/2015Dave CTask 5 detailsDave CIBM to confirm if they can produce sample files ealierMedHighOpenR401/01/2011RED
settu_periasamy
Master III
Master III

Hi,

There is no matching values between your first and second table, right?

1st table Ref values shows ,  1 , 2  , 3 like that.

2nd table Ref values has R1, R2 , R3

I just changed the 1st table value as R1 and R2.. it is working fine.

May be check the attachment..

Not applicable
Author

Hi there,

Thanks for the reply. In the table I pasted above, there are the same values - have pasted again below

Not sure what the issue is!

   

ProjectrefDependent
5.1R1
5.1R2R1
5.1R3R2
5.1R4R3
5.1R5R4