Maths for File Opened in Previous week?

Discuss your general Proclaim related queries here.
Tardisgx
Posts: 30
Joined: Wed Jun 19, 2019 10:35 am
Has thanked: 10 times
Been thanked: 1 time

Maths for File Opened in Previous week?

Post by Tardisgx »

Using this week as an example, if I ran a report with this criteria on the 23rd I would want cases from the 16th to the 22nd.

If I ran the same thing on the 29th I would want the same result 16th to the 22nd. That is what I mean by previous week.

Whereas if I ran this on the 30th I would want cases from the 23rd to the 29th.

I suppose I would have to have a maths field that calculates file opened week of the year from the file opened date and minus that from the today week number, in one maths field rather than 3 to make this easier.

I'm going to try to write this but if someone has this already that would be cool.

steve
Posts: 470
Joined: Wed Nov 30, 2011 10:20 pm
Been thanked: 120 times

Re: Maths for File Opened in Previous week?

Post by steve »

is this a useful starting point?

Code: Select all

v1 = WEEKDAY( TODAY ) 
IF v1 = "Monday" THEN 
    vdays = -7  
ELSEIF v1 = "Tuesday" THEN 
    vdays = -8  
ELSEIF v1 = "Wednesday" THEN 
    vdays = -9  
ELSEIF v1 = "Thursday" THEN 
    vdays = -10  
ELSEIF v1 = "Friday" THEN 
    vdays = -11  
ELSEIF v1 = "Saturday" THEN  
    vdays = -12 
ELSE 
    vdays = -13
END 
vstart = DATE-FROM-TODAY( vdays ) 
vdays + 7
vend = DATE-FROM-TODAY( vdays )

Tardisgx
Posts: 30
Joined: Wed Jun 19, 2019 10:35 am
Has thanked: 10 times
Been thanked: 1 time

Re: Maths for File Opened in Previous week?

Post by Tardisgx »

Cool thanks although it's not what I thought i needed my parameters changed and once i saw what that calculates this will be great :D