Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Announcements

Breathe easy -- you now have more time to plan your next steps with Qlik!
QlikView 11.2 Extended Support is now valid through December 31, 2020. Click here for more information.

Chanty4u
Not applicable

RE:Script error

hi all,

I hve master calender when i am usng innerjoin it shwng error......

y it is shwng error in temp calender?

1 Solution

Accepted Solutions
jagan
Not applicable

Re: RE:Script error

Hi,

Try like this

Data:

SELECT

Field1,

Field2,

Sum(Field3) AS Field3,

Sum(Field4) AS Field4

FROM TableName

Group By Field1, Field2;

18 Replies
tamilarasu
Not applicable

Re: RE:Script error

Hi Suresh,

Could you post your script or application.?

Chanty4u
Not applicable

Re: RE:Script error

MinMax:

Load

Max(Date) as MaxDate,

Min(Date) as MinDate

Resident TASKDETAILS;

// Creating Date Variables

Let vMinDate=Num(Peek('MinDate',0,'MinMax'));

Let vMaxDate=Num(Peek('MaxDate',0,'MinMax'));

Let vToday = $(vMaxDate);

Drop Table MinMax;

// TEMPORARY CALANDER

TempCal:

Load

     Date($(vMinDate)+ RowNo() -1) as TempDate

     AutoGenerate $(vMaxDate) - $(vMinDate) +1;

    

//*****Master Calender*****

MasterCalender:

Load

TempDate as Date,

    Year(TempDate) as Year,

    Month(TempDate) as Month,

    Day(TempDate) as Day,

    Week(TempDate) as Week,

    WeekEnd(TempDate) as WeekEnd,

    'Q' &Ceil(Month(TempDate)/3) as Quarter,

    Date(MonthStart(TempDate),'MMM-YYYY') as MonthYear,

    InYearToDate(TempDate,$(vToday),0) *-1 as CurYTDFlag,

    InYearToDate(TempDate,$(vToday),-1) *-1 as LastYTDFlag

    Resident TempCal;

Drop Table TempCal;

tamilarasu
Not applicable

Re: RE:Script error

The above script works for me. Where is your inner join.?

simone_spanio
Not applicable

Re: RE:Script error

Hi,

the script you posted works for me too.

What kind of error are you getting?

S.

Chanty4u
Not applicable

Re: RE:Script error

that is calender

below is script

TASKDETAILS:

LOAD

    PROJECT_NUMBER,

    TASK_PROJECT_DESC AS PROJECT_DESC,

    TASK_CODE AS TSK_TASK_CODE,

    TASK_NAME AS  TSK_TASK_NAME,

//     TARGET_START_DATE,

//     TARGET_END_DATE,

//     EARLY_START_DATE,

//     EARLY_END_DATE,

//    ACT_START_DATE,

//    ACT_END_DATE,

    COMPONENTS as TSK_COMPONENTS,

    COMPONENT_DESCRIPTION as TSK_COMPONENT_DESCRIPTION,

    COST_CODE,

    PHYS_COMPLETE_PCT as TSK_PHYS_COMPLETE_PCT,

    TASK_ID as TSK_TASK_ID,

    PROJ_ID,

    PROD_SUPERVISOR_CODE,

    PROD_SUPERVISOR_NAME,

    DISCIPLINE_CODE,

    DISCIPLINE_ID,

    DISCIPLINE_NAME,

    FACILITY_CODE,

    FACILITY_NAME,

    LOCATION_CODE,

    MAIN_COMP as TSK_MAIN_COMP,

    MAIN_COMP_DESC as  TSK_MAIN_COMP_DESC ,

    MILESTONE as TSK_MILESTONE,

    PROGRESS_AS_OF_CURRENT_MONTH,

    PROGRESS_AS_OF_LAST_MONTH,

    BASE_START_DATE as Date,

    'Bstart' as TransType,

     BASE_START_DATE

   // BASE_END_DATE

FROM [lib://Project Apps/PPROGRESS_P6TASK_Details_V.qvd]

(qvd);

FIRST TABLE

TASKDETAILS1:

INNER JOIN(TASKDETAILS)

LOAD

    PROJECT_NUMBER,

    TASK_PROJECT_DESC AS PROJECT_DESC,

    TASK_CODE AS TSK_TASK_CODE,

    TASK_NAME AS  TSK_TASK_NAME,

//     TARGET_START_DATE,

//     TARGET_END_DATE,

//     EARLY_START_DATE,

//     EARLY_END_DATE,

//    ACT_START_DATE,

//    ACT_END_DATE,

    COMPONENTS as TSK_COMPONENTS,

    COMPONENT_DESCRIPTION as TSK_COMPONENT_DESCRIPTION,

    COST_CODE,

    PHYS_COMPLETE_PCT as TSK_PHYS_COMPLETE_PCT,

    TASK_ID as TSK_TASK_ID,

    PROJ_ID,

    PROD_SUPERVISOR_CODE,

    PROD_SUPERVISOR_NAME,

    DISCIPLINE_CODE,

    DISCIPLINE_ID,

    DISCIPLINE_NAME,

    FACILITY_CODE,

    FACILITY_NAME,

    LOCATION_CODE,

    MAIN_COMP as TSK_MAIN_COMP,

    MAIN_COMP_DESC as  TSK_MAIN_COMP_DESC ,

    MILESTONE as TSK_MILESTONE,

    PROGRESS_AS_OF_CURRENT_MONTH,

    PROGRESS_AS_OF_LAST_MONTH,

   // BASE_START_DATE,

    BASE_END_DATE as Date,

    'BEnd' as TransType,

     BASE_END_DATE

   

FROM [lib://Project Apps/PPROGRESS_P6TASK_Details_V.qvd]

(qvd);

TASKDETAILS1:

INNER JOIN(TASKDETAILS)

LOAD

    PROJECT_NUMBER,

    TASK_PROJECT_DESC AS PROJECT_DESC,

    TASK_CODE AS TSK_TASK_CODE,

    TASK_NAME AS  TSK_TASK_NAME,

//     TARGET_START_DATE,

//     TARGET_END_DATE,

//     EARLY_START_DATE,

//     EARLY_END_DATE,

//    ACT_START_DATE,

//    ACT_END_DATE,

    COMPONENTS as TSK_COMPONENTS,

    COMPONENT_DESCRIPTION as TSK_COMPONENT_DESCRIPTION,

    COST_CODE,

    PHYS_COMPLETE_PCT as TSK_PHYS_COMPLETE_PCT,

    TASK_ID as TSK_TASK_ID,

    PROJ_ID,

    PROD_SUPERVISOR_CODE,

    PROD_SUPERVISOR_NAME,

    DISCIPLINE_CODE,

    DISCIPLINE_ID,

    DISCIPLINE_NAME,

    FACILITY_CODE,

    FACILITY_NAME,

    LOCATION_CODE,

    MAIN_COMP as TSK_MAIN_COMP,

    MAIN_COMP_DESC as  TSK_MAIN_COMP_DESC ,

    MILESTONE as TSK_MILESTONE,

    PROGRESS_AS_OF_CURRENT_MONTH,

    PROGRESS_AS_OF_LAST_MONTH,

   // BASE_START_DATE,

    BASE_END_DATE as Date,

    'BEnd' as TransType,

     BASE_END_DATE

   

FROM [lib://Project Apps/PPROGRESS_P6TASK_Details_V.qvd]

(qvd);

Chanty4u
Not applicable

Re: RE:Script error

PFA

error

tamilarasu
Not applicable

Re: RE:Script error

What is your Date field format (BASE_START_DATE).? Seems the Min and max date not taken properly.

simone_spanio
Not applicable

Re: RE:Script error

Hi,

in this line

Date($(vMinDate)+ RowNo() -1) as TempDate

AutoGenerate $(vMaxDate) - $(vMinDate) +1;

it seems that the two variables are empty. You can see that even in TASKDETAILS 0 rows are fetched.

So the issue, in my opinion, is not on calendar part of script but in TASKDETAILS joins.

S.

skusuma1991
Not applicable

Re: RE:Script error

Hi suresh,

How can we run this script?specify the error which you are getting in detail.