Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

last date

hi,

how do i calculte count for some field for the max day?

emp:

count(distinct(myfield)) , i want to show only for the max date that i have ( the same if i chose the date manule).

thanks'

yarin.

3 Replies
tresesco
MVP
MVP

Define a variable like:

vMax =Date(Max(DateField))   // Put '=' in the definition of the variable

Then expression should be like: =Sum({<DateField={'$(vMax)'}>} Distinct YourField)

anbu1984
Master III
Master III

count({<datefield={$(=Max(datefield))}>} distinct myfield)

jagan
Luminary Alumni
Luminary Alumni

Hi,

Try like this

Create a variable like this

vMaxDate  = Date(Max(DateDimensionName))  

Note: your DateDimension values and Today() should be in same format

Now use below expression

=Sum({<DateDimensionName={'$(vMaxDate)'}>} Distinct DimensionName)

If you don't want to use variables then try like this

=Sum({<DateDimensionName={'$(=Date(Max(DateDimensionName)))'}>} Distinct DimensionName)


Hope this helps you.


Regards,

Jagan.