Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Qualify without dot

   Hi,

I want to use Qualify and UnQualify for the tables but i dont want to represent it as tablename.columnname

I just want tablenamecolumnname

could you please suggest me

6 Replies
marcus_sommer

AFAIK this couldn't customized but you could after the qualifying rename these fields.

- Marcus

Anonymous
Not applicable
Author

if i could rename the fields i wouldnot go for Qualify option.

I will straight away use aliasing.

Mark_Little
Luminary
Luminary

HI John,

That is how Qualify works, if you not want to do that when then an options maybe to look at using friendly names,

How to Rename Fields

Mark

sunny_talwar

We see your point, but I guess that is how QlikView's Qualify work and I don't think there is a way to change the default settings as Marcus already mentioned

petter
Partner - Champion III
Partner - Champion III

You can achieve your requirements with a little bit of code without having to manually rename each field:

QUALIFY *;

Data:

LOAD

  *

FROM

    ......;


FOR i=1 TO NoOfFields('Data')

  fn = FieldName(i,'Data');

  TRACE Field# $(i) = '$(fn)';

  newfn = 'Data' & SubField(fn,'.',2);

  RENAME FIELD [$(fn)] TO [$(newfn)];

NEXT

I showed this for a single table but you can also do it for multiple tables by having an extra FOR ... NEXT loop wrapping the FOR ... NEXT for each field...

nt = NoOfTables();

FOR t=1 TO $(nt)

  tn = TableName(t-1);

  FOR i=1 TO NoOfFields(tn)

  fn = FieldName(i,tn);

  newfn = tn & SubField(fn,'.',2);

  TRACE Field# $(i) = [$(fn)] will be renamed to [$(newfn)] ;

  RENAME FIELD [$(fn)] TO [$(newfn)];

  NEXT

NEXT

rubenmarin

Nice code. I want only comment that in case table names contains dots newfn can be created like:

newfn = tn & Mid(fn, Len(tn) +2);