Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Learn how to migrate to Qlik Cloud Analytics™: On-Demand Briefing!
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Maxdate parameter in expression

Hi Everyone,

This one is going to come off as pretty dumb, but I'm forgetting something or skipping something simple in my expression.

All I want is the count of IDs, with the maxDate as the expression. But I'm not sure how to set up that expression with the function in it, and finding proper syntax within the community is far from easy.

So imagine the regular count of IDs:

=count(distinct ID)

I'd like the count to be for the maxDate only, either using a variable set to max(theDate) or the function within the expression itself, something like:

=count({<theDate = max(theDate)>} distinct ID)

this syntax is wrong, I know, but I'm not sure what to add/take away to make it function properly. Any help?

Thanks

1 Solution

Accepted Solutions
sunny_talwar

May be this

=count({<theDate = {"$(=Date(Max(theDate), 'YYYY-MM-DD'))"}>} distinct ID)

View solution in original post

7 Replies
its_anandrjs
Champion III
Champion III

Try to write

=count( { < theDate =  {$(=max(theDate) ) }   >} distinct ID)

its_anandrjs
Champion III
Champion III

Actually try this

=count( { < theDate =  {'$(=Date(max( theDate )) )' }   >}  Distinct Doc_name)

Or

=count( { < theDate =  {'$(=Date(max( theDate )) )' }   >}   Doc_name)

Or

=count( { < theDate =  {$(=max(theDate) ) }   >} distinct Doc_name)

Anonymous
Not applicable
Author

I'm getting 0 as the result, I've attach the simplified qlik to my original and maybe you can write the expression until it works?

I have inline loaded the dates as exactly the dates numbers... so they may need to be reformatted I suppose. Perhaps that's an issue as well. Sorry

Creating the maxDate as a variable and using that would also be totally fine.

sunny_talwar

May be this

=count({<theDate = {"$(=Date(Max(theDate), 'YYYY-MM-DD'))"}>} distinct ID)

Anonymous
Not applicable
Author

nailed it, thanks Sunny!

its_anandrjs
Champion III
Champion III

Ok it is date format issue

Try and see attached also

=count({< theDate = { '$(=max(theDate))' }>} distinct ID)

its_anandrjs
Champion III
Champion III

Did you check my reply as well.