Skip to main content
Announcements
Qlik Introduces a New Era of Visualization! READ ALL ABOUT IT
cancel
Showing results for 
Search instead for 
Did you mean: 
mayankraoka
Specialist
Specialist

Reloading qlikview application monthly through Publisher

Hi All,

I have too reload my qlikview application through publisher monthly.For example: Reload application every month Tuesday after 3rd Saturday.Is this possible to schedule to reload based on the above condition.

I am aware that we can do on every weekday there is option on trigger to run monthly on every 3rd Saturday.But not for 1st Tuesday after 3rd Saturday.

For example:

For month of April Qlik data load process should happen on night of 17th (3rd Tuesday) while in May it will be on night of 22nd (i.e. 4th Tuesday)

Can anyone helps me on this?

Regards,

Mayank

3 Replies
hector_munoz
Specialist
Specialist

Hi Mayank,

I donot know if that is possible with QV Server Console but you could do the following:

  • You could reload the document daily and look at the current day.
  • If the day is tuesday after the 3rd saturday of the month you go on with the reload.
  • Else:
    • If you have dependent documents waiting this one to finish in order to execute themselves and you donot want them to do it, you can abort the current reload with a sintaxis fail.
    • If you have dependent documents waiting this one to finish in order to execute themselves and you donot mind them to do it or this has no dependents, then EXIT SCRIPT.

How you you if the day is tuesday after the 3rd saturday of the month? Using this formula:

LET vsThisIsTheDay =Num(Day(Today())) = Num(Pick(Num(Weekday(MakeDate(Year(Today()), Month(Today())))) + 1, 23, 22, 21, 20, 19, 18, 24));

Hope this helps you!

Regards,

H

mayankraoka
Specialist
Specialist
Author

Hi Hector,

Thanks for your reply.

Can you please explain the below logic?How it is checking 1st Tuesday after 3rd Saturday

LET vsThisIsTheDay =Num(Day(Today())) = Num(Pick(Num(Weekday(MakeDate(Year(Today()), Month(Today())))) + 1, 23, 22, 21, 20, 19, 18, 24))

Regards,

Mayank

hector_munoz
Specialist
Specialist

Hi Mayak,

What I do in the expession is compare current day (Num(Day(Today()))) with the first tuesday after the third saturday (rest of the expression).

Steps for the second part of the expression:

  • Weekday(MakeDate(Year(Today()), Month(Today())))): number of the weekday of the first day of the current month. For example, if we are in April, the 1st April is saturday, so this expression will return 5. 0-monday, 1-tuesday, ..., 6-sunday.
  • To the above result we add 1 as Pick() uses a range starting at 1.
  • Then, if the weekday of the 1st day of the current week is monday (1), the first tuesday after the third month will be the day 23, if tuesday then 22, if wednesday then 21, ..., if sunday then 24.

You can test that:

  • if a month starts in monday, the first tuesday after the third saturday is the 23 (as May'17 or Jan'18)
  • if a month starts in tuesday, the first tuesday after the third saturday is the 22 (as Aug'17 or May'18)
  • if a month starts in wednesday, the first tuesday after the third saturday is the 21 (as Feb'17 or Mar'17)
  • if a month starts in thursday, the first tuesday after the third saturday is the 20 (as Jun'17 or Feb'18)
  • if a month starts in friday, the first tuesday after the third saturday is the 19 (as Sep'17 or Dec'17)
  • if a month starts in saturday, the first tuesday after the third saturday is the 18 (as Abr'17 or Jul'17)
  • if a month starts in sunday, the first tuesday after the third saturday is the 24 (as Jan'17 or Oct'17)

Regards,

H