Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
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
AFAIK this couldn't customized but you could after the qualifying rename these fields.
- Marcus
if i could rename the fields i wouldnot go for Qualify option.
I will straight away use aliasing.
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,
Mark
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
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
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);