Forum Discussion

rs1249's avatar
rs1249
Icon for Helper I rankHelper I
7 years ago

return a text based on several conditions using lookupvalue

Hi Guys, I have a table with these columns and value:

Name Entry_Type Document_No Doc No Cust_Ledger_Entry_No
10Bit FX Application CRD-0000166 24497
10Bit FX Initial Entry INV-0001367 INV-0001367 24497
10Bit FX Application CRD-0000166 24526
10Bit FX Initial Entry CRD-0000166 CRD-0000166 24526
10Bit FX Application BANK-0000675 24541
10Bit FX Initial Entry INV-0001368 INV-0001368 24541
10Bit FX Application BANK-0001422 24556
10Bit FX Initial Entry INV-0001369 INV-0001369 24556
10Bit FX Application BANK-0000675 27027
10Bit FX Initial Entry BANK-0000675 BANK-0000675 27027
10Bit FX Application BANK-0001422 36537
10Bit FX Initial Entry BANK-0001422 BANK-0001422 36537
10Bit FX Application BANK-0001961 38950
10Bit FX Initial Entry INV-0002424 INV-0002424 38950
10Bit FX Application BANK-0001961 40910
10Bit FX Initial Entry BANK-0001961 BANK-0001961 40910

I create a measure call the doc no to return doc no of the Inital Entry to all all associated rows for each customer ledger entry no.

Doc No =
Var currentitem =SELECTEDVALUE(Detailed_Cust_Ledg_Entries[Entry_Type])
var currentitem2 = SELECTEDVALUE(Detailed_Cust_Ledg_Entries[Entry_No])
var currentitem3 =SELECTEDVALUE(Detailed_Cust_Ledg_Entries[Document_No])
return
SWITCH(True(),
currentitem = "Initial Entry",currentitem3,
currentitem="application",LOOKUPVALUE(Detailed_Cust_Ledg_Entries[Document_No],Detailed_Cust_Ledg_Entries[Entry_Type],"Initial Entry",Detailed_Cust_Ledg_Entries[Entry_No],currentitem2))
 
The first switch statement worked, as you can see in the table, but second one with Lookupvalue function doesn't work, I just can't see why?
 
Please help me!!! thanks in advance
No RepliesBe the first to reply