Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Row Value to Data Table

HI

I have following table with below data

tableA:

Product
Stock Dead Level
From Date
Todate
Status
A201 jan 2012 30 jun 2012Green
B301 mar 2012 31 dec 2012Yellow
......................

and i am looking for QV script which convert this table into following table

tableB:

Date
Product
Stock Dead Level
Status
1 jan 2012A20Green
2 jan 2012A20Green
................
....................
30 junA20Green
1 mar 2012B30Yellow
2 mar 2012B30Yellow
..................
31 dec 2012B......Yellow

regards

1 Solution

Accepted Solutions
Gysbert_Wassenaar

T1:

LOAD Product, [Stock Dead Level],

             date#([From Date],'D MMM YYYY') as [From Date],

             date#([Todate],'D MMM YYYY') as [Todate], 

             Status INLINE [

    Product, Stock Dead Level, From Date, Todate, Status

    A, 20, 1 jan 2012, 30 jun 2012, Green

    B, 30, 1 mar 2012, 31 dec 2012, Yellow

];

T2:

load *, date([From Date]+IterNo()-1,'D MMM YYYY') as Date

Resident T1 While [From Date]+IterNo()-1<=Todate;

drop table T1;

See attached qvw


talk is cheap, supply exceeds demand

View solution in original post

1 Reply
Gysbert_Wassenaar

T1:

LOAD Product, [Stock Dead Level],

             date#([From Date],'D MMM YYYY') as [From Date],

             date#([Todate],'D MMM YYYY') as [Todate], 

             Status INLINE [

    Product, Stock Dead Level, From Date, Todate, Status

    A, 20, 1 jan 2012, 30 jun 2012, Green

    B, 30, 1 mar 2012, 31 dec 2012, Yellow

];

T2:

load *, date([From Date]+IterNo()-1,'D MMM YYYY') as Date

Resident T1 While [From Date]+IterNo()-1<=Todate;

drop table T1;

See attached qvw


talk is cheap, supply exceeds demand