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

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
bxprokop
Contributor II
Contributor II

Separating A String And Filling In Value Between A Range (Subfield)

First Off, I know I can use Subfield function to add rows for the "," and even the "-" dashes.  What I am trying to figure out is how can I populate the missing values in the range of items with the "-".

Example: String is 30-50.  I can use Subfield(Field name, "-" to get the following:

Row 1: 30

Row 2: 50

What I want to get is:

Row 1: 30

Row 2: 31

Row 3: 32

Etc.

Attached is a sample file with data I am trying to do this with in the Qlik Script.  Any help would be greatly appreciated.

Thanks

Brian

 

1 Reply
AshutoshBhumkar
Partner - Specialist
Partner - Specialist

Hello,

I have created a sample data and script. Please check if that helps.

 

Table:
Load Range,SubField(Range,'-',1) as From, SubField(Range,'-',2) as To Inline [
Range
30-50
60-70
];

NoConcatenate

Load
Range,
From + IterNo() - 1 as RangeIteration
Resident Table
While IterNo() <= To - From + 1 ;
DROP Table Table;
Exit Script;

 

Output:

AshutoshBhumkar_0-1636171635421.png

AshutoshBhumkar_1-1636171678629.png

 

Thanks,

Ashutosh