Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

Not applicable

Data set question: need to update columns

Hi Friends, I have  a dataset like below , whee A,B,C are column names and SalesQty,SalesValue,ReturnValue ,so on are data. Is it possible to add as column name SalesQty,SalesValue,ReturnValue  by removing column names as A,B,C in Query.

ABC
SalesQtySalesValReturnVal
101002
132004

I want to remove column name A,B,C . New dataset will be

SalesQtySalesValReturnVal
101002
132004

Is it possible in qliksense by writing query?

5 Replies
sinanozdemir
Valued Contributor III

Re: Hi Friends, I have a dataset like below , whee A,B,C are column names and col1,col2,col3,SalesQty,SalesValue,ReturnValue ,so on are data. Is it possible to add as column name SalesQty,SalesValue,ReturnValue by removing column names as A,B,C

Hi,

You can actually "-" and "+" buttons to get rid of the extra headers:

Capture.PNG

As you can see Header size: 2 did the trick:

Capture.PNG

Hope this helps.

Other useful links by Sinan:

Handling Metadata in QlikView

QlikView and Python Integration

QlikView Automation Series – Unzip & Load Excel Files

Not applicable

Re: Hi Friends, I have  a dataset like below , whee A,B,C are column names and col1,col2,col3,SalesQty,SalesValue,ReturnValue ,so on are data. Is it possible to add as column name SalesQty,SalesValue,ReturnValue  by removing column names as A,B,C

Thanks Dear,

but I am merging multiple sql files which is may not possible unselect or select in drop down list.

Is it possible to do in query??

Only I want to assign SalesQty,SalesValue.,ReturnVal as column name in Query.

Thanks,

Bibhuti

sinanozdemir
Valued Contributor III

Re: Hi Friends, I have a dataset like below , whee A,B,C are column names and SalesQty,SalesValue,ReturnValue ,so on are data. Is it possible to add as column name SalesQty,SalesValue,ReturnValue by removing column names as A,B,C in Query.

I am not quite sure about your data, but you can try something like the below:

Capture.PNG

You can use IsNum() function to get rid of string/text values and then rename the columns as you would like.

Hope this helps.

phaneendra_kunc
Valued Contributor III

Re: Hi Friends, I have a dataset like below , whee A,B,C are column names and SalesQty,SalesValue,ReturnValue ,so on are data. Is it possible to add as column name SalesQty,SalesValue,ReturnValue by removing column names as A,B,C in Query.

Try this.. this will automatically does it.

ColumnNames: //Just read Header and first row --- You can use "RowNum() in SQL instead of First

first 1

LOAD 1 as XYZ, //This is mandatory to work with crosstable -- just add this with rest of hte columns

  A,

    B,

    C  

FROM

test.xlsx

(ooxml, embedded labels, table is Sheet3);

Temp:

CrossTable(From, To)

LOAD XYZ,

    A,

    B,

    C

Resident ColumnNames;

Drop Field XYZ;

RenameFields:

Mapping Load * Resident Temp;

Drop Tables Temp,ColumnNames;

Data:

LOAD A,

    B,

    C

FROM

test.xlsx

(ooxml, embedded labels, table is Sheet3) where RecNo()>1; // Dont read the first row as it has column names

RENAME Fields using RenameFields; //This will rename old column names with new one

MVP
MVP

Re: Hi Friends, I have a dataset like below , whee A,B,C are column names and SalesQty,SalesValue,ReturnValue ,so on are data. Is it possible to add as column name SalesQty,SalesValue,ReturnValue by removing column names as A,B,C in Query.

Hi,

Try like this

LOAD

A as SalesQty,

B as SalesVal,

C as ReturnVal

FROM DataSource

WHERE A <> 'SalesQty';

Hope this helps you.

Regards,

Jagan.

Community Browser