Problem with @Left

Hi,

I have a problem with a Computed For Display field, which contains a DBColumn. This field holds the following value : “News!!; More news!!” which is the concatenation of two rows of data, separated by a semi-colon.

I have some Computed Text which does an @Left on the above field, but all it ever picks up is a comma??

any ideas??

Subject: Problem with @Left

@Left works on list so if the formula is returning a comma then it sounds like the source field is a multivalue field (2 values) and nothing is returned from the @left command resulting in two empty values.

What is the exact formula you are using.

Subject: RE: Problem with @Left

Hi,

My source field is a multi-value field, because i’m capturing the contents of a view column. It’s @Text(@DBColumn(view etc…).

I’m then trying to separate the values from the multi-value field, starting with @Left.

I want to parse out each value of my multi-value field into pieces of Computed Text.

The idea is that the DBColumn gets a list of news items for a Javscript news ticker, then each bit of Computed Text, which is pass-thru HTML for the ticker, picks up each element of the multi-value field.

Subject: RE: Problem with @Left

tList := A-1234;B-1646;C-7642;

@Left(tList ; “-”) will return → A;B;C

@Left(tList ; 3) will return → A-1;B-1;C-7

@Left(tList ; “x”) will Return → ;; since no values were

What is the exact formula you are using.

Subject: RE: Problem with @Left

I have used @Implode on List, which has allowed me to get a value into my Computed Text - thanks for the help.

I now have a slightly different issue.

My Computed For Display field is :

@Implode(@Text(@DbColumn(“”:“”;“”:“”;“News”;1));“*”)

My Computed Text is then:

Res:=@Left(Links;“*”);

Value:=@If(Res!=“”;“”+Res+“


”;NULL);

Value

My problem now is, I have a list of values in my CFD field, but i’m not sure how to separate them to add individually to pieces of Computed Text, like the one above. The one above of course only works for the first element, but how do I now get at the rest of the elements of my list?

Thanks for all the help so far.

Subject: RE: Problem with @Left

if you want to add the same values to all the entries returned by @DbColumn(“”:“”;“”:“”;“News”;1), Then you can do something like this:

tList := @DbColumn(“”:“”;“”:“”;“News”;1)

Values := “”+ tList +“


”;

If you want to add different values to values returned by @DbColumn(“”:“”;“”:“”;“News”;1) then use an @for loop:

tList := @Trim(@DbColumn(“”:“”;“”:“”;“News”;1));

tNewList := “”;

@For(n := 1;

n <= @Elements(tList);

n := n + 1;

tNewEntry := @If(tList[n] = xxxxxx ; cccccccc + tList[n] + yyyyyyyyyyy ; "");

tNewList :=  @If(tNewList = "" ; tNewentry ; @Trim(tList : tNewEntry))

);

tNewList

Note: This is an example I have not actually run the code :wink:

Subject: RE: Problem with @Left

You might look at using @Word if you know the position in the list of each value that you want to extract. Syntax is @Word( string ; separator ; number ).

For example, @Word(list; “;”; 3) will return the third value in a list separated by semicolons.

Subject: RE: Problem with @Left

Hi Guys,

It’s great to come in to work on a Monday morning to find you’ve helped me out!

I’ve used Christine’s @Word code, which does what I want nicely. Thanks to everyone else for helping me out too, it’s much appreciated!

Subject: Trying Using @Subset

The only way @Left will do you any good is if you had done an @Implode on the list, such as

@left(@Implode(List;“,”);“,”)