Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Simple Question: Automatic generation of the table name with the field name

Hi,

I ask you a simple question, I just want to load my QVD's without automatic generation of his name, with the fields.
Note: I have not added any manipulation script, it's automatic and it's only on some applicables QVD (tables).


Example:

Case: QVD_Name.NameField

I just want to load my QVD without "BillingDocumentLinesTemp" automatically. Because I tried to  rename it ( all fields) with " as " but it still have a different name.

Goal: Only NameField

90.PNG.png


It's very Urgent, Thanks for your Help!

1 Solution

Accepted Solutions
salto
Specialist II
Specialist II

Hi,

I have tried this and works for me:

After loading the first table (being a QVD or not):

LET QVDNumber = 0;

After Loading every table (being a QVD or not):

LET QVDNumber = $(QVDNumber) +1;

After loading every QVD table:

LET OldName = TableName($(QVDNumber));

LET NewName = subfield(TableName($(QVDNumber)), '.',2);

rename table $(OldName) to $(NewName);

I am sure this code can be more elegant, using the TableNo() function

View solution in original post

12 Replies
Anonymous
Not applicable
Author

Hayfa

Are you using a Qualify statement ?  If so then comment it out and reload.

Best Regards,     Bill

salto
Specialist II
Specialist II

Hello,

NoOfTables() will give you the number of tables in your script. So at the end of your script try adding these pseudocode lines:

For i = 1 to NoOfTables()

  LET OldName = TableName(i);

  LET NewName = subfield(OldName , '.' , 2); //Assuming that there an only dot!

  rename table OldName to NewName;

Next i

Hope this helps!

Not applicable
Author

Bill,

No, I haven't use the "Qualify" statement in this QVD!!

Not applicable
Author

SALTO,

You mean in the end of the script of the QVD created ( before generate QVD) or in the end of the script that call the QVD generated ( after Load QVD file )??

rustyfishbones
Master II
Master II

Whoever created the QVD's obviously set them to be named that way.

Can you get the QVD's extracted again and have them named differently?

Regards

Al

salto
Specialist II
Specialist II

I would try at the end of the script after LOAD QVD file.

I still have not managed my code to work, but I'll let you know.

Not applicable
Author

Ok, I'm trying also, thank you!

salto
Specialist II
Specialist II

Hi,

at the beggining of the script:

LET QVDNumber = 0;

After the load of every QVD:

LET QVDNumber = QVDNumber +1;

LET OldName = TableName($(QVDNumber ));

LET NewName = subfield(TableName($(QVDNumber )), '.',2);

LET NewName = $(OldName);

Good luck!

Not applicable
Author

Okey SALTO, Thanks!