Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
I need to convert this table into a horizontal table. Tried cross table but I receive an error that "Field names must be unique for a table. How can this be accomplished. Tried Generic load also but that is not working either.
Horizon:
LOAD
BatchID AS BatchID_Horiz,
Name AS Name_Horiz,
Answer AS Answer_Horiz
FROM [lib://Perryman_Summary_Data/00_QVD/Horizon.qvd]
(qvd);
Horizon2:
CrossTable(BatchID_Horiz,Name_Horiz,2)
Load *
Resident Horizon;
// Generic Load
// BatchID AS BatchID_Horiz,
// 'part'&"Name AS AS Name_Horiz,
// Answer AS Answer_Horiz
// Resident Horizon;
// Drop table Horizon;
The goal is to get 1 row for each batch ID. The column headings would be the value in the current "Name" column and the result for the column is the Answer.
I think Generic load like this would work,
Horizon:
Generic LOAD
BatchID AS BatchID_Horiz,
Name,
Answer
FROM [lib://Perryman_Summary_Data/00_QVD/Horizon.qvd]
(qvd);
What issue did you have with using Generic load?
-Rob
I think Generic load like this would work,
Horizon:
Generic LOAD
BatchID AS BatchID_Horiz,
Name,
Answer
FROM [lib://Perryman_Summary_Data/00_QVD/Horizon.qvd]
(qvd);
What issue did you have with using Generic load?
-Rob
Do you specifically need to do this in your script? On the front end, this is as simple as creating a pivot with BatchID as the dimension, Name as the Column, and Only(Answer) as the measure, so if you don't specifically need it in script I'd recommend doing that.
If you specifically need it done in script, have a look at previous answers to the same question, e.g.
https://community.qlik.com/t5/App-Development/how-to-pivot-in-load-script/td-p/1513761
Thank You the Generic Load worked. I wanted to convert this to a horizontal table to make every column searchable. End users have no idea what the Back ID is and want o search by the row names.