Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

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;

Tags (2)
1 Solution

Accepted Solutions
Not applicable

Re: Re: Script error to order the Time Dimension table

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

5 Replies
Not applicable

Re: Script error to order the Time Dimension table

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

Re: Script error to order the Time Dimension table

Could you share your qvw?

Not applicable

Re: Script error to order the Time Dimension table

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


Not applicable

Re: Re: Script error to order the Time Dimension table

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

Re: Script error to order the Time Dimension table

Thanks...

Community Browser