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

Announcements
Join us in Bucharest on Sept 18th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
kdaniels-obrien
Partner - Creator
Partner - Creator

Merging multiple rows into one and creating new columns

Hi,

I would like to merge multiple rows into one row while creating 2 addition columns.  I have minute by minute data coming into Qlik and I would like to turn each minute-row with consecutive & matching values into one row and add 2 new columns to that row that will end up representing start and end time.  I would prefer to do this in the chart functions (within the sheet) but if it must be done in the load editor, that's okay.   Here is my use case:  A machine is running for 10 minutes.  Right now I see 10 separate rows of data with timestamp (being the only value that is changing)  showing that the machine is running from 12PM to 12:10PM.  Instead, I would like to see 1 row showing that the machine is running with 2 new columns for the start time (at 12) and the end time (at 12:10).  If machine or status change, I would expect to see a new row with a new start and end time referring to the change. 

Here is a sample of the data: 

sample data 1.pngexpect sample.png

In my load editor, I am loading lots of column names from a .qvd file and have played around with using a peek function. in the chart functions, I have been using Above function.   Please help 🙂 Thank you in advance!

Labels (1)
13 Replies
kdaniels-obrien
Partner - Creator
Partner - Creator
Author

I do have it written as <>, I may have deleted the < when copying and pasting.  I think the error has to do with how StatusFlag is defined.  

Kushal_Chawda

Would you be able to share the sample file or script snippet? Otherwise it will be hard to say where the issue is 

kdaniels-obrien
Partner - Creator
Partner - Creator
Author

Could you explain how I could do something similar to StatusFlag in the presentation layer as a master item?

Kushal_Chawda

It will be  complex and not advisable to do it at presentation layer. If you can share your script I can help to find issue