Skip to main content
Announcements
Customer Spotlight: Discover what’s possible with embedded analytics Oct. 16 at 10:00 AM ET: REGISTER NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
manoj217
Creator III
Creator III

concatinate the fields

Hi all,

i have 1400 fields in my data but i want to concatenate all fields how to concatenate all the fields by using looping

7 Replies
vishsaggi
Champion III
Champion III

May be this helps check here:

How to get a list of fields in load script?

however, i still wonder why you want to concatenate 1400 fields. They are many to be in the data model.

manoj217
Creator III
Creator III
Author

i have 1400 fileds but i want to left first 5 fields and concatenate remaining 1396 fields

marcus_sommer

Do you mean fields or fieldvalues within a field? What is the aim of concatenating them?

- Marcus

manoj217
Creator III
Creator III
Author

Hi

i have fields like A,B,c,d,e,f.......upto 1000 fields. now i want to concatenate fields c,d,e,f,g.....upto 1000. just i am omit A,B  like that i want.

there we have more than 1000 fields so i can't write concatenate keyword to all the fields so i want automatic looping operation

andrey_krylov
Specialist
Specialist

I think you need a code like below

  vString = '';

  FOR vCounter = 1 TO NoOfFields('YourTable')

      vCurrentField = FieldName($(vCounter), 'YourTable');

      IF not Match(vCurrentField, 'A', 'B', 'C'...) THEN

          vString = vString & ', [$(vCurrentField)]';

      ENDIF

  NEXT

  vString = Right(vString, Len(vString) - 2);

  Concatenate([YouNewTable]): LOAD $(vString) Resident [YourTable] ;

manoj217
Creator III
Creator III
Author

it is showing error

andrey_krylov
Specialist
Specialist

Sorry, did not check. In Match() function paste fieldnames you don't want

vString = '';

  FOR vCounter = 1 TO NoOfFields('YourTable')

      vCurrentField = FieldName($(vCounter), 'YourTable');

      IF not Match(vCurrentField, 'A', 'B') THEN

          vString = vString & ', [$(vCurrentField)]';

      ENDIF

  NEXT

  vString = Right(vString, Len(vString) - 2);

  Concatenate([YouNewTable]) LOAD $(vString) Resident [YourTable] ;