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.
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

Re: Row Value to Data Table

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
1 Reply

Re: Row Value to Data Table

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
Community Browser