Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
psk180590
Creator III
Creator III

Issues with calendar script

Hello All,

In an existing qlikview application i have an calendar script which generates Min, Max and many other objects for various types of categories. But, it consumes very long time(~24 minutes) where as the rest portion consumes ~4 minutes. Does anyone have an idea of a faster calendar script and also tips to generalize calender objects.

TIA!!

8 Replies
sunny_talwar

vinieme12
Champion III
Champion III

There is this The Fastest Dynamic Calendar Script (Ever)

But exactly what part is taking the time?

Vineeth Pujari
If a post helps to resolve your issue, please accept it as a Solution.
psk180590
Creator III
Creator III
Author

Hi Vineeth,

Below is my Calender Script:

DateListIST:

  LOAD

  Min(%Key_Date) as MinDate1,

  Max(%Key_Date) as MaxDate1

  Resident Facts

  Where Key = 1;

  Join(DateListIST)

  LOAD

  Min(%Key_Date) as MinDate2,

  Max(%Key_Date) as MaxDate2

  Resident Facts

  Where Key= '2';

  Join(DateListIST)

  LOAD

  Min(%Key_Date) as MinDate3,

  Max(%Key_Date) as MaxDate3

  Resident Facts

  Where Key= '3';

  Join(DateListIST)

  LOAD

  Min(%Key_Date) as MinDate4,

  Max(%Key_Date) as MaxDate4

  Resident Facts

  Where Key= '4';

  Join(DateListIST)

  LOAD

  Min(%Key_Date) as MinDate5,

  Max(%Key_Date) as MaxDate5

  Resident Facts

  Where Key= '5';

  Join(DateListIST)

  LOAD

  Min(%Key_Datum) as MinDate6,

  Max(%Key_Datum) as MaxDate6

  Resident Facts

  Where Key= '6'

When i check the log file each of this is consuming ~4 mins individually.

vinieme12
Champion III
Champion III

Refer the link posted by Sunny and use Field Value instead.

But why are you referring the same field for multiple keys? why don't you use the min and max dates found among all keys?

Vineeth Pujari
If a post helps to resolve your issue, please accept it as a Solution.
stabben23
Partner - Master
Partner - Master

LOAD distinct
peek('%Key_Datum',0,'Facts') as MinDate1,
Peek('%Key_Datum',-1,'Facts') as MaxDate1
Resident Facts;

Hi, Maybe a peek will make it faster, To use Min and Max in a large dateset will take some time.

You should also do a order by asc on Your Facts table.

psk180590
Creator III
Creator III
Author

I'm fetching the dates from a Fact table which has been concatenated with data from various tables and "Key" in the above script shows which table the data belongs too.

Also, i need to show this tables separately in the dashboard with select able time periods for each.

psk180590
Creator III
Creator III
Author

Thanks Staffan,

I will try this too along with the other suggestions.

vinieme12
Champion III
Champion III

Use Fieldvalue(), Refer link posted by stalwar1

Vineeth Pujari
If a post helps to resolve your issue, please accept it as a Solution.