Forum Discussion
Fiscal Week Calendar Help
Hi Anonymous
What is the logic to be applied to put the weeknum in Table 2 based on Table 1 Value.
Will Table 1 will have only one value always ?
Cheers
CheenuSing
Hi Anonymous
Table 1: is the selection of people who were sent communications. Every one was sent the communication on the same day so the date will be static.
Table 2: Is the sign ups with amount paid and othe related financial information
Both tables are tables in SQL Server.
Thanks
- Anonymous7 years agoNot applicable
Hi Anonymous
Try this
ByWhichWeek = Calculate( WEEKNUM(MIN([SignUp])) - WEEKNUM( MAX(Table1[Date])) )This assumes there is only one row in Table 1 and many rows in Table1 and both are not related.
Is this what you expected.
Cheers
CheenuSing
- Anonymous7 years agoNot applicable
Anonymous wrote:Hi Anonymous
Try this
ByWhichWeek = Calculate( WEEKNUM(MIN([SignUp])) - WEEKNUM( MAX(Table1[Date])) )This assumes there is only one row in Table 1 and many rows in Table1 and both are not related.
Is this what you expected.
Cheers
CheenuSing
Hi Anonymous This seems to do the trick, thanks.
FYI: not sure if the below will make a difference to the code as it seems to work perfectly.
There is more than one row and more than one column in Table 1, but the Date in Table 1 is static. Table 1 is communication Selection so includes what type of Comms they received, Customer ID
Date in table 2 is dynamic.
Table 1 and Table 2 have a relationship based on Customer ID.
- Anonymous7 years agoNot applicable
Hi Anonymous
Here's a question for you. There are a few rows, around 5 that exist in table 2 but not table 1. This causes the calculation to be wrong. Is there a way to use a fixed date if (Table 1)[Date] does not exist.
Otherwise I was thinking to add a column in the table 2 for Date as it will be static and use the below formula however the 40 is static.
ByWhichWeek =VAR __fw = [Date] - 40 + 1RETURN IF(__fw<=0,52+__fw,__fw)Thanks- Anonymous7 years agoNot applicable
Hi Anonymous ,
Can you please upload some data for Table1 and Table2 and the output expected on Goodlge / One Drive and share the link here to find the right solution.
Cheers
CheenuSing