Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi Team,
I have the data from 1950 till 2049 now i got the requirment to calculate the noof days in year.
suppose if i click on
1-JAN-1950 --- 1
1-JAN-1960 --- 1
2-JAN-1980 --- 2
3-JAN-1990 --- 3
10-JAN-2040--- 10
.;
;
;
31-JAN-2050 --- 31
am able to populate the above solution but when i go to next month then also it is showing the same result
1-FEB-1950 --- 1
1-FEB-1960 --- 1
2-FEB-1980 --- 2
3-FEB-1990 --- 3
10-FEB-2040--- 10
But requirement is like that if we select FEB month then it should increase in sequential order till the December
they are looking for some thing like
1-FEB-1950 --- 32
2-FEB-1950 --- 33......
28-FEB-2016----59
29-FEB-2016----60
1-MAR-2016 --- 60
2-MAR-2017 --- 61
Reagrds,
KK
kush141087sureshqvQlikView Forums & Resources
Date - YearStart(Date) +1 as DayNumOfYear
should work then.
There is also a function DayNumberOfYear, which is based on a 366 days year.
How do you calculate the number?
Have you tried:
=Max(DATEFIELD) - YearStart(Max(DATEFIELD)) +1
?
You can do something like below
Data:
LOAD Date
FROM table;
New:
noconcatenate
LOAD *,
if(Date<>Previous(Date),rangesum(peek('Days'),1),1) as Days
Resident Data
order by Date asc;
drop table Data
I was using the normal form as
day(Date) as DayNum which is giving the position or day number
Hi Karim,
Try this:
=Interval(Max(DATEFIELD)-YearStart(Max(DATEFIELD)),'DD')
Kind regards
Assuming that You have all the dates in calender
Data:
LOAD Date,
Year
FROM table;
New:
noconcatenate
LOAD *,
if(rowno()=1 or Year<>previous(Year),1,if(Year=previous(Year) and Date<>Previous(Date),rangesum(peek('Days'),1),1)) as Days
Resident Data
order by Year,Date asc;
drop table Data;
or try simple if like below
if(rowno()=1 or Year<>previous(Year),1,rangesum(peek('Days'),1)) as Days
Manuel as per ur code is is working but it is taking one day less count
if I will click on 31Jan then it is taking 30
Add one Day manually.
Kind regards
done just use +1