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.
pedlopes
New Contributor III

for loop in qlikview with dates

Hi,

Can you help me with this?

LET y=Date(Num#(Today()));

FOR i=Date(Num#('2015-01-01','YYYY-MM-DD')) to '$(y)'

Fact_apk_appdownloads:

Load*;

SQL SELECT "added_date",

    "app_package",

    "downloads",

    "id",

    "store_id"

FROM "aptstats_db"."stats_apk_appdownloads"."data_ed418c0c40177ea81381dd993e9f9cd82cb169aa_$(i)";

STORE * FROM Fact_apk_appdownloads into ..\QVD Generator\QVD Generator aptoide_db\Fact_apk_appdownloads\Fact_apk_appdownloads_$(i).qvd;

DROP Table Fact_apk_appdownloads;

NEXT i

3 Replies

Re: for loop in qlikview with dates

I have modified your script based on your need. Please check whether it works for you

LET y = Today();

For i = Date(Date#('2015-01-01','YYYY-MM-DD')) to y

LET vFileDate = Date(i, 'YYYY-MM-DD');

Fact_apk_appdownloads:

Load*;

SQL SELECT "added_date",

    "app_package",

    "downloads",

    "id",

    "store_id"

FROM "aptstats_db"."stats_apk_appdownloads"."data_ed418c0c40177ea81381dd993e9f9cd82cb169aa_$(vFileDate)";

STORE * FROM Fact_apk_appdownloads into ..\QVD Generator\QVD Generator aptoide_db\Fact_apk_appdownloads\Fact_apk_appdownloads_$(vFileDate).qvd;

DROP Table Fact_apk_appdownloads;

NEXT i

pedlopes
New Contributor III

Re: for loop in qlikview with dates

Thank you it's work

Community Manager
Community Manager

Re: for loop in qlikview with dates

Hi Pedro,

Please take a moment to mark Celambarasan's reply as Correct by following the steps outlined here: Qlik Community Tip: Marking Replies as Correct or Helpful

Thank you,

Qlik Community Team

Community Browser