Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

script to load table if first friday of month, otherwise continue

Dear all,

I have a dashboard which is reloaded daily, sourcing from many different datasets.

Especially one dataset is really massive and refreshed anyway just monthly.

Therefore I am looking for ways to AVOID to reload this dataset, unless we are on the first friday of the month (when this dataset is refreshed).

So far I just came to this point

if(Day(today()))<=7 then

Demand:

CrossTable(Month,Demand,3)

LOAD

purgechar(PROD,CHR(32)) as SKU,

the problem I am having is that the script does not go any further afterwards.


So how can I have both the script:

- check if we are in the FIRST Friday of the month

- when we are not, skip the subsequent LOAD section, but still continue in processing the script?

I have the feeling I should be reaching what I want by using if then or if else, but I cannot really make something out of it...

Thank you very much

1 Solution

Accepted Solutions
Clever_Anjos
Employee
Employee

if day(Today()) <= 7 and WeekDay(Today()) = 'fri' then

  // Load your table

end if

View solution in original post

5 Replies
Clever_Anjos
Employee
Employee

if day(Today()) <= 7 and WeekDay(Today()) = 'fri' then

  // Load your table

end if

Not applicable
Author

hi

try this

if day(Today()) <= 7 and WeekDay(Today()) = 'Fri'

then

Not applicable
Author

Wow, that easy!

I was drowning in an inch of water, thanks!

just to point out, I think that by default the parameters set at the beginning of the script have the days written as Mon, Tue etc. and not mon, tue.

so for your script to work out, "fri" needs to be changed to "Fri"

Clever_Anjos
Employee
Employee

In my case, would be 'sex', because my QV is in Portuguese

Not applicable
Author

actually, I badly formulated my question.

By doing so, the data will not visible in the dashboard for the whole month, besides the first friday.

Indeed, what I would like to achieve is that the data is not reloaded throughout the month, as it is the same; but it is indeed kept and visible within the dashboard!