Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Announcements
QlikView Fans! We’d love to hear from you.
Share your QlikView feedback with the product team… Click here to participate in our 5-minute survey.
Rules, plus terms and conditions, can be found here.
jeckstein
Contributor

Expanding table based on row value

Hi all and thanks in advance.

I was to take the following table. Each combination of date and ID should have the number of rows as in the count table.

DateIDCount
1/1/2018ABC3
1/2/2018ABC2
1/3/2018ABC2
1/1/2018DEF4
1/2/2018DEF2
1/3/2018DEF1

This following table is my desired result. The combination of Date=1/1/2018 and ID=ABD has 4 rows because the count for this combination is 4 in the table above.

DateIDCount
1/1/2018ABC1
1/1/2018ABC1
1/1/2018ABC1
1/2/2018ABC1
1/2/2018ABC1
1/3/2018ABC1
1/3/2018ABC1
1/1/2018DEF1
1/1/2018DEF1
1/1/2018DEF1
1/1/2018DEF1
1/2/2018DEF1
1/2/2018DEF1
1/3/2018DEF1

Thanks again!!!

1 Reply

Re: Expanding table based on row value

Hi,

one solution might be:

QlikCommunity_Thread_289932_Pic1.JPG

table1:

LOAD RowNo() as RowNo,

    Date,

    ID,

    1 as Count

FROM [https://community.qlik.com/thread/289932] (html, codepage is 1252, embedded labels, table is @1)

While IterNo()<=Count;

hope this helps

regards

Marco

Community Browser