Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik GA: Multivariate Time Series in Qlik Predict: Get Details
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Loading script Add column

Hello,

My data:

Table:

Timestamp User Type      Object

1              J      Sheet      SH15

2              J      Selection Filter1

3              J      Selection Filter2

4              J      Sheet      SH17

5              J      Selection Filter1

It means that the user J have selected Filter 1 and Filter 2 in the sheet SH15 .

I would like to have another column "Sheet" in my table to know what filter corresponds to what sheet.

Do you have any ideas?

Thank in advance

7 Replies
Anonymous
Not applicable
Author

just add a field as

Table:

Timestamp User Type      Object     Sheet

1              J      Sheet      SH15            Sheet15

2              J      Selection Filter1          Sheet15

3              J      Selection Filter2          Sheet15

4              J      Sheet      SH17             Sheet17

5              J      Selection Filter1           Sheet17

Not applicable
Author

I can't do that because there are a lot of data

Anonymous
Not applicable
Author

from where are you loading this data..

We can get the sheet id at front end , i dont think that there is any function to get it at script level.

May be from your datasource only we can check if a new relevant column can be added

Gysbert_Wassenaar
Partner - Champion III
Partner - Champion III

Something like this:

Load Timestamp, User, Type, Object, if(Type='Sheet',Object,peek('Sheet')) as Sheet

From ...


talk is cheap, supply exceeds demand
Not applicable
Author

Claire,

You can export the structure of your document: Settings / Document Properties / tab Sheets / button Export Structure

Then, you can do 1) a mapping Load to load this structure (link between your object and the dimension)   2) do an applymap() as newCol to create the new column

Fabrice

Anonymous
Not applicable
Author

Table_temp:

load * inline[

Timestamp User Type      Object     Sheet

1              J      Sheet      SH15            Sheet15

2              J      Selection Filter1          Sheet15

3              J      Selection Filter2          Sheet15

4              J      Sheet      SH17             Sheet17

5              J      Selection Filter1           Sheet17

];

noconcatenate

Table:

Load *

if(left(Object,2)='SH',Object,peek(Object,-(mid(7)))) as Sheet

resident Table_temp;

Drop tale table_temp;

Not applicable
Author

Add this below to expression to have new column.

If(match(Object,'Filter1','Filter2'),'Sheet15','Sheet17')

Thanks.