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

Script error to order the Time Dimension table

Hi,

I'm doing a simple script to order the Time Dimension table...

After the reload the table DimTimeMonthly is not loaded, without the last code line "Drop Table DimTimeMonthly_Temp;",

the table DimTimeMonthly is loaded with duplicated lines?!

Provably it's a very simple code error...

Thanks in advance...

MonthNr:

Mapping

LOAD * INLINE [

    Month, MonthID

    Jan, 1

    Feb, 2

    Mar, 3

    Apr, 4

    May, 5

    Jun, 6

    Jul, 7

    Aug, 8

    Sep, 9

    Oct, 10

    Nov, 11

    Dec, 12

];

DimTimeMonthly_Temp:

LOAD MonthID,

     MonthName,

     Mid(MonthName,1,3) as Month,

     YearID,

     YearName as Year,

     RelativeMonthID,

     MATID,

     MATOrderID,

     MAT,

     ,ApplyMap('MonthNr',Mid(MonthName,1,3), 'NA') as MonthNr

FROM

..\DataSources\$(vQVDsBeg_Name)DimTimeMonthly.qvd

(qvd)

where RelativeMonthID>0;

DimTimeMonthly:

LOAD *

Resident DimTimeMonthly_Temp

order by MonthNr;


Drop Table DimTimeMonthly_Temp;

1 Solution

Accepted Solutions
Not applicable
Author

Here is an example:

DimTimeMonthly:

NoConcatenate

LOAD *

Resident DimTimeMonthly_Temp

order by MonthNr;

If you don't use NoConcatenate, then QlikView will just ignore the statement, because the 2 tables have identical columns (identical column names and identical number of columns).

View solution in original post

5 Replies
Not applicable
Author

Correction:


Hi,

I'm doing a simple script to order the Time Dimension table...

After the reload the table DimTimeMonthly is not loaded, without the last code line "Drop Table DimTimeMonthly_Temp;",

the table DimTimeMonthly_Temp is loaded with duplicated lines?!

Provably it's a very simple code error...

Thanks in advance...

MonthNr:

Mapping

LOAD * INLINE [

    Month, MonthID

    Jan, 1

    Feb, 2

    Mar, 3

    Apr, 4

    May, 5

    Jun, 6

    Jul, 7

    Aug, 8

    Sep, 9

    Oct, 10

    Nov, 11

    Dec, 12

];

DimTimeMonthly_Temp:

LOAD MonthID,

     MonthName,

     Mid(MonthName,1,3) as Month,

     YearID,

     YearName as Year,

     RelativeMonthID,

     MATID,

     MATOrderID,

     MAT,

     ,ApplyMap('MonthNr',Mid(MonthName,1,3), 'NA') as MonthNr

FROM

..\DataSources\$(vQVDsBeg_Name)DimTimeMonthly.qvd

(qvd)

where RelativeMonthID>0;

DimTimeMonthly:

LOAD *

Resident DimTimeMonthly_Temp

order by MonthNr;


Drop Table DimTimeMonthly_Temp;

Not applicable
Author

Could you share your qvw?

Not applicable
Author

Hello, you have to use "NoConcatenate" because your temp table and your "permanent" table have the exact same columns.


Not applicable
Author

Here is an example:

DimTimeMonthly:

NoConcatenate

LOAD *

Resident DimTimeMonthly_Temp

order by MonthNr;

If you don't use NoConcatenate, then QlikView will just ignore the statement, because the 2 tables have identical columns (identical column names and identical number of columns).

Not applicable
Author

Thanks...