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.
sushil353
Honored Contributor II

how to load previous day data

Hi All,

I need to develop an application in which there is a time dimention with Time_date and time_id fields..

I want to load/schedule my application in such a manner, it has previous day data avaliable...

Means how to get the previous day data and  aply the filter....

Thanks..

8 Replies

how to load previous day data

Hi,

   Do you mean to say your application should have only Pre. Day data. or do you mean you need pre. and today data too.

   And what filters you are applying and on what.

   Please describe in more details.

Regards,

Kaushik Solanki

Not applicable

how to load previous day data

I think you want to show the comparison between the current date and previous date data in a chart may be a straight table or a barchart.

U can write that code if you have a date field in ur table structure.And Date must be in proper Date field,not in string actually...

Current Date Data:--sum({$<Date={$(=Max(Date))}>} Sales)

Prev. Date Data:--sum({$<Date={$(=Max(Date)-1)}>} Sales)

Try and reply me.

Thanks and regards,

Koushik.

sushil353
Honored Contributor II

how to load previous day data

@ Kaushik,

The application should contain only previous day data.....I have Time_date field in ' 01-Jan-2011' format...and i need to  schedule it every day to refresh the previous day data...

Thanks

how to load previous day data

Hi,

   You can try this.

   Load Field1,

    Field2,

   Time_Date

    from xyz where Time_Date = date(today()-1,'DD-MMM-YYYY');

Regards,

Kaushik Solanki

sushil353
Honored Contributor II

how to load previous day data

@ Kaushik

it is giving error

SQL error: ORA-00936: missing expression

ORA-00936: missing expression

Script line: SELECT *  FROM "DW_OWNER"."TIME_DIM"  WHERE TIME_DATE=Date(Today()-1,'DD-MMM-YYYY')

SQL SELECT *

FROM "DW_OWNER"."TIME_DIM"

WHERE TIME_DATE=Date(Today()-1,'DD-MMM-YYYY')

Not applicable

how to load previous day data

Ohh no,I told you the expression of qlikview to show data not to load data.I am sorry sushil.

U can load all data by select *from (Table name).

and when u r going to represent the comparison chart then put that expressions.

Got It.

Thanks.

Koushik.

how to load previous day data

Hi,

   If you are using this in SQL statement then instead of Date function you sould use below function.

   Where Time_Date = To_Date(Today()-1,'DD-MMM-YYYY')

Regards,

Kaushik Solanki

sushil353
Honored Contributor II

how to load previous day data

Hi Koushik Roy,

Thanks for your opinion....

But i need to load only last day data becaz data size is huge...and store that previous day data in qvd file for further use in applications.....

i have written script as:

Time:

LOAD "TIME_ID",

    "TIME_DATE",

    "DAY_OF_MONTH",

    "WEEK_OF_YEAR",

    "WEEK_STARTING_DATE",

    "MONTH_OF_YEAR",

    "MONTH_NAME",

    QUARTER,

    "YEAR_OF_YEAR",

    "HALF_YEAR";

SQL SELECT *

FROM "DW_OWNER"."TIME_DIM"

WHERE TIME_DATE=Date(Today()-1,'DD-MM-YYYY');

it is giving error as described above

Community Browser