cancel
Showing results for 
Search instead for 
Did you mean: 

Copy Look Upvalue first 4 values

former_member283645
Participant
0 Kudos

Hi Experts,

I have this requirement where I need to copy the first 4 values in to a field.

Ex:

Description (Field Name)

Look up values are..

4233 - warehouse

6452 - store

8792 - Bulk warehouse

Now whenever the user selects a lookup value from this field, the first 4 values should be copied to a field called 'Site Code'.

I have written an assignment on site code field .. LEFT(Description.[Record], 4)

But the values are not copied !!!! means assignment did not work.

is this possible to copy on selected lookup values for any record?If so am i following the right validation or missing something!!!!

Issue 2:

This is one more thought of issue 1..

i need to compare this 4 digit value with a field called 'Code'.

So IF Code = First 4 values of Description then True Else False..

Will it be possible to write This validation, I tried but did not work..

Can anyone help me please..

Kind Regards

Eva

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Hey Eva,

For Issue 1:

Using assignments is easier if "Site Code" is Lookup Table with similar Display Field in which you are copying values.

I guess in the current scenario the numeric part is the Display field.Please check and confirm.

For Issue 2:

I think this is very much possible,you can hardcode TRUE/FALSE based on IF(....,then,else)

Try

IF(LEFT(Description.record,4) = Code.record,TRUE,FALSE)

Let me know your findings.

Thanks,

Ravi

former_member283645
Participant
0 Kudos

Hi all,

Thanks for the responses.

I have tried IF(LEFT(Description.record,4) = Code,TRUE,FALSE)

And this validation did not work.

Description is a lookup field So selected Description.Record

Code is a text field with length as 4, So selected as Code

Also tried IF(LEFT(TRIM_LEFT(Description.[Record]),4) = Code , FALSE)

Even this did not work..

Could anyone help me please..

Kind Regards

Eva

Former Member
0 Kudos

Eva,

Could you please try this...

Lookup table Name: Table1

Field Name: Description

MID(Table1.Description,1,4)

the same thing you can try for the other validation too....

hope this helps.

thanks,

Alexander.

former_member283645
Participant
0 Kudos

Hi Guys,

Thanks for the Responses..

I have tried all the below validations, where none Worked..

MID(Table1.Description,1,4)

IF(LEFT(Description.record,4) = Code,TRUE,FALSE)

IF(LEFT(TRIM_LEFT(Description.Record),4) = Code , FALSE)

Did anyone try anything different other than these which actually worked ??

Kind Regards

Eva

former_member283645
Participant
0 Kudos

The requirement is dropped so closing the thread.

Former Member
0 Kudos

Hello Eva

Are you have field type text?

if your answer = Yes

You need use TRIM_ALL or TRIM_LEFT function because you text strin may contain spaces before your number

Your expresiion shall be

LEFT(TRIM_LEFT(DEscription),4)

If your answer = No

i 'm not sure that you can easy transform your value to text because in expression builder function for value to text transformation is absent

for values you need use somthing like

if(code-9999 >=0, [your code more or equal than 9999], if(code - 999>=0, [your code more or equal than 999 but less than 9999]))

Sure you can store your result to numeric field - if you want to store result to text field you shall to set text value in your expression results part

etc.

Regards

Kanstantsin Chernichenka

Edited by: Kanstantsin Chernichenka on Jul 11, 2011 9:28 PM