Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Create new table from existing data

Hi all,

I have some data in Excel, structured as a Pivot, containing 2 fields, with a value per combination - like the example below:

TIME
Field Xt0t1t2
AA123
BB123
CC123
XX123
YY123
ZZ123

Whereby "Field X" and "Time" are the fields, and the values (in this example) are all 1, 2, and 3.

But what I want is to convert this table into something usable in QV, so that all combinations of values are automatically prepared in a new table in the script, like so:

FIELD XTIMEVALUE
AAt11
AAt22
AAt33
BBt11
BBt22
BBt33

I understood that Loop could help, but no idea on how to actually script this, as there are hundreds of values with long historical values to include.

Any ideas?

Thanks!

1 Solution

Accepted Solutions
Not applicable
Author

Hi Mayil,

That function seems to do what I want, but I seem to have a problem in the script (shows a Syntax error)...

I used the Crosstable wizard to generate the script, but the whole Crosstable section shows up as an error (including the CROSSTABLE function itself...)

Any ideas why?

View solution in original post

5 Replies
MayilVahanan

Hi

Try like use crosstable:

crosstable(time,value)

load * from tablename;

Hope it helps

Thanks & Regards, Mayil Vahanan R
Please close the thread by marking correct answer & give likes if you like the post.
Not applicable
Author

Hi Mayil,

That function seems to do what I want, but I seem to have a problem in the script (shows a Syntax error)...

I used the Crosstable wizard to generate the script, but the whole Crosstable section shows up as an error (including the CROSSTABLE function itself...)

Any ideas why?

jonathandienst
Partner - Champion III
Partner - Champion III

Hi

If you want help in debugging your script, it would be a help if you posted the relevant portion of the script.

Regards

Jonathan

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein
MayilVahanan

Hi

http://community.qlik.com/message/134713#134713

http://community.qlik.com/message/82902#82902

Example for crosstable..

Please check the syntax in this..

Thanks & Regards, Mayil Vahanan R
Please close the thread by marking correct answer & give likes if you like the post.
Not applicable
Author

Thanks Mayil,

Silly error - used bad fieldnames in the script!

Made a small amendment and now it works!

Thanks