Quantcast
Viewing all articles
Browse latest Browse all 217217

Calculating number of weeks between two dates from different year

Hi,

 

 

 

Situation is like this: Suppose i Have a drug data with its expiry date:

 

Drug NameExp
Alp 32002-12-2018
B02-10-2017
C12-04-2016
D22-04-2010
E03-07-2020
F23-05-2017
G24-05-2016
H25-05-2016
I26-05-2018
J27-05-2016
K27-05-2019
L29-05-2011
M30-05-2012
N03-01-2010
O03-06-2016
P02-06-2017

 

 

Exp. date is of different year.

 

Now I have another column with date, based on which I calculated the week number.

 

Current DateWeek number
14-08-201634
15-08-201634
16-08-201634
17-08-201634
18-08-201634
19-08-201634
20-08-201634
21-08-201635
22-08-201635
23-08-201635
24-08-201635
25-08-201635
26-08-201635
27-08-201635
28-08-201636
29-08-201636
30-08-201636
31-08-201636
01-09-201636
02-09-201636
03-09-201636
04-09-201637

 

Now I have 2 slicer from this: Year and Weeknum.

When I select year as 2016 and week as 34 then I should get the name of drugs with their week to expiry data. (how many weeks remaining to expire the medicine)

 

 

I tried:  weeknum(exp) - weeknum(current date)

for same year (exp year = 2016) it is working fine for other years it is not working fine.

 

I am trying for a dynamic report where i can go to past or futer and figure out at tht time how many weeks were remaining for the drug to expire.

 

Meaning based on week slicer I should be able to see the data according to the week selected.

 

Thanks.. Please advise.


Viewing all articles
Browse latest Browse all 217217

Trending Articles