4 Replies Latest reply: Nov 28, 2017 4:55 AM by Max Beer

# Comparing with a constant value

Hi there,

I am trying to figure out how many users have been active in a certain period of time. I can use this to find out the amount of days since their last login:

But comparing it to a constant (in this case 30, for 30 days) does not yield any results:

count({< {30} = {'>=\$(=ceil(Interval(Today()-date([users.last_login], 'DD.MM.YYYY'), 'D'), 1))'}>} DISTINCT users.id)

Any suggestions on what I'm doing wrong?

Thanks

• ###### Re: Comparing with a constant value

Try this

Count({< users.id = {"=Ceil(Today() - [users.last_login], 1) <= 30"}>} DISTINCT users.id)

• ###### Re: Comparing with a constant value

Hi Sunny,

Could you just explain to me what the statement " users.id  = ..." does?
When and how do you have to use such terms?

Regards

• ###### Re: Comparing with a constant value

user.id =  is a boolean search where the expression only show rows where the expression results as TRUE. To see which rows are included create a straight table and add user.id as dimension and add =Ceil(Today() - [users.last_login], 1) <= 30 as expression.... next, make sure that you have unchecked 'Suppress Zero Values' on the presentation tab and you will see bunch of -1s and 0s against user.id.... All those places where you see -1 are the rows that are included in your expression.... 0 rows are excluded.

Does that make sense?

• ###### Re: Comparing with a constant value

It does, thanks for the explanation and the help in general!