cancel
Showing results for 
Search instead for 
Did you mean: 

Read many applications with lookup

Former Member
0 Kudos

Hi all,

I need to read two applications with LOOKUP to make the right calculation in the expression of a *REC, with assumptions located in two different applications. Example : Expression = Assump1 * Assump2 * Get(...)

It seems that only one LOOKUP can be entered at the begining of the LGF file to load assumptions. If two lookups are entered, it only takes the last one, the others are not filled.

Can you tell me how you manage to get data from more than one application ?

Thanks and regards,

Laurent

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi Laurent,

Try to move the data in those two lookup apps to a single app and use this app for lookup from the 3rd app.

Or, you can just move around the data within these 3 apps within any of the 2 apps and then use a combination of one lookup and get function in the target app.

Karthik AJ

Former Member
0 Kudos

Hi,

Thanks for your answer. I moved the two assumptions in only one application and changed the script.

But the problem now is that if I lookup only one assumption it reads and applies perfectly, but when there are two of them in the lookup it only applies the first one. There is may be something about cartesian product, but how to deal with it ?

Here is the code.

Comments :

Frais_candidat is assigned to "NON_AFF" for both grade and entity

Taux_affectation is assigned to the same Entity and Grade as the source account "ETP"

In this case, only "Frais recrutement" is fed, but not "CA_Formation"

-


*LOOKUP HYPOTHESES

*DIM INPUTCURRENCY = RPTCURRENCY

*DIM TAUX_AFFECTATION : ENTITY = ENTITY

*DIM FRAIS_CANDIDAT : ENTITY = "NON_AFF"

*DIM TAUX_AFFECTATION : ACCOUNT = "TAUX_AFFECTATION"

*DIM FRAIS_CANDIDAT : ACCOUNT = "FRAIS_CANDIDAT"

*DIM TAUX_AFFECTATION : GRADE = GRADE

*DIM FRAIS_CANDIDAT: GRADE = "NON_AFF"

*ENDLOOKUP

*WHEN ACCOUNT

*IS FILLED

*REC(EXPRESSION = LOOKUP(FRAIS_CANDIDAT),ACCOUNT=FRAISRECRUTEMENT)

*REC(EXPRESSION = LOOKUP(TAUX_AFFECTATION),ACCOUNT=CA_FORMATION)

*ENDWHEN

-


Here is the query generated for this table :

select ACCOUNT,ENTITY,GRADE,TIMEID,SIGNEDDATA

into #tblTempLogic_254903

from tblFactHYPOTHESES

WHERE ACCOUNT in (N'TAUX_AFFECTATION',N'FRAIS_CANDIDAT') AND CATEGORY=N'BUDGET1' AND ENTITY in (N'PARIS',N'NON_AFF') AND GRADE in (N'ASSOCIE',N'NON_AFF') AND INPUTCURRENCY=N'EUR' AND TIMEID in (N'20080100',N'20080200',N'20080300',N'20080400',N'20080500',N'20080600',N'20080700',N'20080800',N'20080900',N'20081000',N'20081100',N'20081200')

Thanks for your help !

Laurent

Edited by: Laurent ALLAIS on Dec 7, 2011 11:51 AM

Former Member
0 Kudos

Hi,

Finally I've changed the model to get rid of lookup. There is only one application. So it should be more simple but I still cannot get the data if GRADE and ENTITY are not the same. Still, I see in the debug that the GRADE "NON_AFF" and ENTITY "NON_AFF" are selected by the queries.

If I entered data for FRAIS_CANDIDAT on the same entity and grade, it is copied to "FRAISRECRUTEMENT". But if it is on entity "NON_AFF" and grade "NON_AFF", it is not, I get a zero.

Can you tell me where is the error ?

-


*XDIM_ADDMEMBERSET GRADE = "NON_AFF"

*XDIM_ADDMEMBERSET ENTITY = "NON_AFF"

*WHEN ACCOUNT

*IS FILLED

*REC(EXPRESSION = GET(ACCOUNT="ETP_RECRUTEMENT") + GET(ACCOUNT="ETP", TIME=PRIOR),ACCOUNT="ETP") // THIS ONE WORKS !!

*REC(EXPRESSION=GET(ACCOUNT="FRAIS_CANDIDAT",ENTITY="NON_AFF",GRADE="NON_AFF"), ACCOUNT="FRAISRECRUTEMENT") // NO DATA RETRIEVED !!!

*ENDWHEN

*COMMIT

-


Thanks in advance,

Laurent

Edited by: Laurent ALLAIS on Dec 7, 2011 9:25 PM

Edited by: Laurent ALLAIS on Dec 7, 2011 9:26 PM

Former Member
0 Kudos

Hi all,

As I found the solution by myself, I post it if someone needs it.

The problem was due to the fact I used the same code "NON_AFF" for both dimensions.

Regards

Laurent

Edited by: Laurent ALLAIS on Dec 8, 2011 8:04 AM