Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Announcements

Breathe easy -- you now have more time to plan your next steps with Qlik!
QlikView 11.2 Extended Support is now valid through December 31, 2020. Click here for more information.

Not applicable

Rename tables in Qlik View with the actual name

Hello everybody,

We are relatively new to Qlik View and now had a question:

We have downloaded several files using the following path:

FROM

[Blocks \ Scanner Data \ CM project Pluskühlung_VTS NP *]

(OOXML, embedded labels, header lines is 1, table is [Total, Total]);

There are a total of 20 files. These are now with CM project Pluskühlung_VTS NP - 1 and CM-project Pluskühlung_VTS NP - 2, etc. loaded. But we want to get the actual name.

This is in the middle of the actual file name on the 31st to 48th in the file name.

At Google, we have not found a solution to this, with the manual, we also come from nowhere.

Have ye here any advice for me?

many Thanks

Michaela

6 Replies
anbu1984
Honored Contributor III

Re: Rename tables in Qlik View with the actual name

Where is your actual file name? Is it within data or present in file name (CM project Pluskühlung_VTS NP - 1) ?

Not applicable

Re: Rename tables in Qlik View with the actual name

Our actual file name is part of the file name

Example: CM Projekt Pluskühlung_VTS NP – West 800…

CM Projekt Pluskühlung_VTS NP – Ost 1000…

We need the part „Ost 1000“ or „West 800” … as part of the field names.

Von: anbu cheliyan

Gesendet: Dienstag, 28. April 2015 17:21

An: Michaela Wittek

Betreff: Re: - Rename tables in Qlik View with the actual name

anbu1984
Honored Contributor III

Re: Rename tables in Qlik View with the actual name

Load *, Mid(Filename(),31,18) As FileName

FROM

[Blocks \ Scanner Data \ CM project Pluskühlung_VTS NP *]

(OOXML, embedded labels, header lines is 1, table is [Total, Total]);

Not applicable

Re: Rename tables in Qlik View with the actual name

Use SubFiled function like below:

SubField( FileName , '-' ,2 )

ankitaag
Contributor III

Re: Rename tables in Qlik View with the actual name

=Mid(Column,31,18) as FieldName

from

.......

Re: Rename tables in Qlik View with the actual name

Hallo Michaela,

another solution could be also:

LOAD irgendwelchefelder,

          Mid(FileBasename(),Index(FileBasename(),'-')+1) as Beschreibung

FROM [Blocks \ Scanner Data \ CM project Pluskühlung_VTS NP *]

(OOXML, embedded labels, header lines is 1, table is [Total, Total]);

This disregards your file extensions and also works for different filename lengths extracting the string starting from the first '-' character.

hope this helps

Gruß

Marco