Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
everest226
Creator III
Creator III

set analysis not working for current year

HI

this expression was working fine till last year(2016) but somehow after in new year it is not working,

basically the logic is to get user for current year till last months,

thanks

=Count (DISTINCT {<Year={'$(=max(Year))'}, Month-={"$(=month(date#(max({<Year={'$(=max(Year))'}>}Month),'MM')))"}>} [Authenticated user])

1 Solution

Accepted Solutions
johnw
Champion III
Champion III

The current year until last month is... nothing.

You tell it to give you the max(Year), which I assume is now 2017. So far so good. But then your month expression, if I'm reading it right, says "but not the max month in the max year", which is to say, "but not January 2017". Well, 2017 without January 2017 is nothing. No months qualify. No data qualifies. So I'd expect the expression to return nothing.

I'm not sure what you WANT it to do instead, but I can see why it's not doing it.

If I'm reading it right, anyway.

View solution in original post

4 Replies
tchovanec
Creator II
Creator II

One trick to see what it is evaluating to, is to put the expression in a straight table and don't label the expression. You can then hover over the label and it will tell you what it is evaluating to.

johnw
Champion III
Champion III

The current year until last month is... nothing.

You tell it to give you the max(Year), which I assume is now 2017. So far so good. But then your month expression, if I'm reading it right, says "but not the max month in the max year", which is to say, "but not January 2017". Well, 2017 without January 2017 is nothing. No months qualify. No data qualifies. So I'd expect the expression to return nothing.

I'm not sure what you WANT it to do instead, but I can see why it's not doing it.

If I'm reading it right, anyway.

everest226
Creator III
Creator III
Author

ya that is true , thanks basically i have to run report every 2th of months ,   which is to get data for current year but till last months i dont want data for two days of current months ,so because 2017 does not has last months that why its not working i guess

sunny_talwar

So are you happy with the result you are getting? If you are, then close this thread down