Skip to main content
Announcements
Accelerate Your Success: Fuel your data and AI journey with the right services, delivered by our experts. Learn More
cancel
Showing results for 
Search instead for 
Did you mean: 
JoseGarcia
Creator III
Creator III

Table content formatting

Hi there, 
Could i show table data below in such format?
original table :

DateAccident  details 1Accident 2details Accident 3details Accident 4details 
07/05/2020Acc 1Det1 Acc2 det2Acc3det3Acc4det4

 

I would like to show it as:

Acc 1Det1 
Acc2 det2
Acc3det3
Acc4det4

 

I am exploring text boxes & concatenating , and also open to suggestions.

Can anyone assist?

Thanks a million! 

Jose

 

1 Reply
klikgevoel
Contributor III
Contributor III

In your case you want to tidy your data (Hadley Wickham Tidy Data  <- good read) from a long table.

Assuming your data has more variables, first in script editor give it a proper naming in a temporary table, followed by concatenation in a final table. 

Example:

[TmpTable]:
LOAD
RecNo() As IndexKey, //Maybe useful since each row in the long table will have a unique key
"Date",
Accident As Accident1,
"details 1" As Details1,
"Accident 2",
details As Details2,
"Accident 3",
details1 As Details3,
"Accident 4",
details2 As Details4
FROM DataSource;

Tidy the TmpTable 

[Final]:
Load
Date,
Accident1 As Accident,
Details1 As Details
Resident TmpTable;

Concatenate(Final) //not explicitely necessary since Qlik will concatenate by names automatically, but to know what is going on
Load
Date,
"Accident 2" As Accident,
Details2 As Details
Resident TmpTable;

//Follow the other columns in same format.

Drop Table TmpTable;