Skip to main content
Announcements
See why Qlik was named a Leader in the 2024 Gartner® Magic Quadrant™ for Data Integration Tools for the ninth year in a row: Get the report
cancel
Showing results for 
Search instead for 
Did you mean: 
vengadeshpalani
Creator
Creator

How to store individual QVD based on field value

Hi all,

I want to store individual QVD based on Date, How can I write the script for that ?

Source:

XXXDate
XX01/01/2018
XYX01/01/2018
XYYYX01/02/2018
X01/03/2018
XX01/03/2018
XXX01/03/2018
XYZ01/03/2018
ZZZ01/02/2018
YYYY01/02/2018

Result:

01/01/2018.qvd

01/02/2018.qvd

01/03/2018.qvd etc...

1 Solution

Accepted Solutions
sunny_talwar

May be this

Table:

LOAD * INLINE [

    XXX, Date

    XX, 01/01/2018

    XYX, 01/01/2018

    XYYYX, 01/02/2018

    X, 01/03/2018

    XX, 01/03/2018

    XXX, 01/03/2018

    XYZ, 01/03/2018

    ZZZ, 01/02/2018

    YYYY, 01/02/2018

];


FOR i = 1 to FieldValueCount('Date')


LET vDate = FieldValue('Date', $(i));

LET vDateSave = Date(FieldValue('Date', $(i)), 'YYYYMMDD');

TempTable:

NoConcatenate

LOAD *

Resident Table

Where Date = '$(vDate)';

STORE TempTable into QVD_$(vDateSave).qvd (qvd);

DROP Table TempTable;


NEXT

View solution in original post

2 Replies
shiveshsingh
Master
Master

Make a variable, store the date and use it in your QVD Name during creation.

sunny_talwar

May be this

Table:

LOAD * INLINE [

    XXX, Date

    XX, 01/01/2018

    XYX, 01/01/2018

    XYYYX, 01/02/2018

    X, 01/03/2018

    XX, 01/03/2018

    XXX, 01/03/2018

    XYZ, 01/03/2018

    ZZZ, 01/02/2018

    YYYY, 01/02/2018

];


FOR i = 1 to FieldValueCount('Date')


LET vDate = FieldValue('Date', $(i));

LET vDateSave = Date(FieldValue('Date', $(i)), 'YYYYMMDD');

TempTable:

NoConcatenate

LOAD *

Resident Table

Where Date = '$(vDate)';

STORE TempTable into QVD_$(vDateSave).qvd (qvd);

DROP Table TempTable;


NEXT