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

Binary Load

Once I have done a Binary load of another qlikview file how do I them manipulate the data on load?

I cannot seem to be able to reference the data from the binary load.

Scenario:

the test.qvw has a loaded data set with FieldA, FieldB, FieldC in table Tester

In a new file I wanted use the same data but the fields need new names, I tried the below but I cannot seem to return any data although I know the Binary Load works as I can see the data in the table viewer.

Binary ;

A_Table:

Load * inline

      [ a,b,c];

Load

     Peek([FieldA]) as a;

     Peek([FieldB]) as b;

     Peek([FieldC]) as c;

Resident A_Table;

Help is much appreciated.

1 Solution

Accepted Solutions
Digvijay_Singh
Honored Contributor III

Re: Binary Load

Try like this, T1 is a table in binary load qvw. -

A_Table:

Load * inline

      [ a,b,c];

  

Load

     right(Peek([FieldA],0,'T1'),3) as a,

     right(Peek([FieldB],0,'T1'),3) as b,

     right(Peek([FieldC],0,'T1'),3) as c

Resident T1;

6 Replies

Re: Binary Load

Roberto Angelucci wrote:

A_Table:

Load * inline

      [ a,b,c];

Load

     Peek([FieldA]) as a;

     Peek([FieldB]) as b;

     Peek([FieldC]) as c;

Resident A_Table;

What exactly are you trying to do here?

MVP
MVP

Re: Binary Load

Do you want to just rename your fields? Then use RENAME FIELD:

Renames one or more existing QlikView field(s) after they have been loaded.

Two differently named fields cannot be renamed to having the same name. The script will run without errors, but the second field will not be renamed.

The syntax is:

rename field (using mapname | oldname to newname{ , oldname to newname })

rename fields (using mapname | oldname to newname{ , oldname to newname })

where:

mapname is the name of a previously loaded mapping table containing one or more pairs of old and new field names.

oldname is the old field name .

newname is the new field name.


Renaming won't work for key fields, though.

Not applicable

Re: Binary Load

Sunny,

Thanks for the response. What I am trying to do is reuse data that is being used from another qlikview file. However once I have loaded the data from the other file, what I am trying to do is then use the same data but to rename the fields to match the new file I am working on and clean the data. as an example. I have the FieldA that in the file is a long string, in the new file I still need the same data but now want to parse the last 3 characters just by doing the following (or I thought the script would be):

Right(Peek(FieldA),3) as a.

However using the script above I do not seem to be able to get the data from FieldA. Ie I can load it using binary and then use it to display the tables but when I try to manipulate the data in the script the tables are empty.

I don't know if this makes sense, but don't really know how to explain it and I cannot load the files up as I have some proprietary info etc in the files.

Re: Binary Load

if your trying to rename the fields with certain modification you could try like this :

New_table:

Load

     [FieldA] as New_a;

    [FieldB] as New_b;

     [FieldC] as New_c;

Resident table_name;//table name as in the qlikview binary load

Digvijay_Singh
Honored Contributor III

Re: Binary Load

Try like this, T1 is a table in binary load qvw. -

A_Table:

Load * inline

      [ a,b,c];

  

Load

     right(Peek([FieldA],0,'T1'),3) as a,

     right(Peek([FieldB],0,'T1'),3) as b,

     right(Peek([FieldC],0,'T1'),3) as c

Resident T1;

Not applicable

Re: Binary Load

Thank you all for the input, this has been really helpful and finally I understand!!!