Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I have a date 11/2017 and a year filter. I'm trying to count the number of months. I
f I select year 2016 in the filter, it returns 0. If select 2017, returns 2 (11/2017, 12/2017). If select 2018, it will count till today, so returns 7 (11/2017, 12/2017, 01/2018, 02/2018, 03/2018/, 04/2018, 05/2018).
What should the function be for this?
Thanks in advance!
I have a date 11/2017 and a year filter.
Where is this date coming from?
year(date) is the year filter.
My question was where is this date coming from
Just Nov 2017
Not sure I understand, is there a sample your can share to explain your problem?
You can try either of these:
=count({$*<Date = {'>=$(=date(date#('11/2017', 'MM/YYYY')))'}>}Date)
=count(if(Date>=date#('11/2017', 'MM/YYYY'), Date))
This assumes that your Date field is in the format of 'MM/YYYY' hence it is just a standard count. You might have to use distinct in your expression as well depending on your data:
=count(DISTINCT{$*<Date = {'>=$(=date(date#('11/2017', 'MM/YYYY')))'}>}Date)
I also assumed your date 11/2017 is hard-coded or a certain date you have in mind. If its dynamic, you might have to use variables and tweak the code.
Hope this helps!
Hi,
U can try this:
Count( {<Date= {">=Date#(11/2017,'MM/YYYY')<=Max(Month))"}>} Month )
May be this?
Count( {<Year_Month= {">=$(=MinString(Year_Month))<=$(=MaxString(Year_Month)))"}>} Month)