Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
helen_pip
Creator III
Creator III

Split a field into multiple rows with values from other fields

Dear Qlikview user

 

I have a data structure issue which I am trying to resolve and was wondering if someone could kindly point me in the right direction

 

I have a table of data which looks as follows

Session ID          Reason       Patients

123456                 No Staff       123

What I hope to achieve from a table structured as follows is the following:

 

Session ID        Reason           Patients 

123456             No Staff               1

123456             No Staff               2

123456             No Staff                3

I have had a play with substring count but cannot seem to get the desired results....If you could kdinly offer any guidance that would be greatly appreciated

 

 

Kind Regards

Helen

 

 

 

 

1 Solution

Accepted Solutions
tresesco
MVP
MVP

Is it so that the resultant Patients would always have single digit number? If so, try like:

Load
	[Session ID],
	Reason,
	Mid(Patients, IterNo(),1) as Patients
While Len(Patients)>=IterNo();
	
Load * Inline [
Session ID, Reason, Patients
123456, No Staff, 123]

View solution in original post

2 Replies
tresesco
MVP
MVP

Is it so that the resultant Patients would always have single digit number? If so, try like:

Load
	[Session ID],
	Reason,
	Mid(Patients, IterNo(),1) as Patients
While Len(Patients)>=IterNo();
	
Load * Inline [
Session ID, Reason, Patients
123456, No Staff, 123]
helen_pip
Creator III
Creator III
Author

Hello,

 

Thank you so much as this  works a treat!  I have tried it with my real data and get the desired results

 

  Kind Regards

Helen