Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

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
Employee
Employee

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

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

  // Load your table

end if

5 Replies
Employee
Employee

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

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

  // Load your table

end if

Not applicable

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

hi

try this

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

then

Not applicable

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

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"

Employee
Employee

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

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

Not applicable

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

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!

Community Browser