Skip to main content
Announcements
See what Drew Clarke has to say about the Qlik Talend Cloud launch! READ THE BLOG
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

if saturday this week is in the same month as saturday last week then..

Hello people,

I want to write a if script saying "if saturday this week (vWeekToCalculate) is in the same month as saturday last week (vPreviousWeek) then calculate "script x" otherwise calculate "script y".

I have these variables:

vWeekToCalculate = (2018xx)

let vPreviousWeek=$(vWeekToCalculate)-1;

Thank for your help.

2 Replies
uacg0009
Partner - Specialist
Partner - Specialist

Hi Burhan,

Sorry i didn't get your point, could you please give some examples and some results that you want?

Thanks.

Aiolos

Anonymous
Not applicable
Author

Hi,

I want to calculate weekly sales, but I have the data on monthly basis (P0,1,2,3....12) it is however updated on a weekly basis.

The problem that I have is that some weeks is included in two different months. Ex. 27,28,29,30,1,2,3 (1,2,3 is belonging to the other month).

Ex. (Week 14) saturday 7 April and (Week 13) saturday 31 March.

In this case I have to use a different calculation to calculate the sales on week 14. Than if I would compare wk 15 and 16 for example which is included in the same month. Then I would just take P0 for week 16 - P0 for week 15 to get the sales for week 16.

I hope I have explained my question better.