Skip to main content
Announcements
Qlik Connect 2025: 3 days of full immersion in data, analytics, and AI. May 13-15 | Orlando, FL: Learn More
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Display the last data point

Hi all

Please how can I display the last data point of the following expression?

=sum({1<Sale_Date={">=$(=Max(Sale_Date)-12)<=$(=Max(Sale_Date))"},Product={'Product 1'}>} Sales)/

Count({1<Sale_Date={">=$(=Max(Sale_Date)-12)<=$(=Max(Sale_Date))"},Product={'Product 1'}>} Sales)


Regards

1 Solution

Accepted Solutions
Anonymous
Not applicable
Author

you are talking about max(Date) only, like this?

=sum({<Sale_Date={'$(=Max(Sale_Date))'},Product={'Product 1'}>} Sales)

/

Count({<Sale_Date={'$(=Max(Sale_Date))'},Product={'Product 1'}>} Sales)

It will give you max date values only

View solution in original post

11 Replies
sunny_talwar

Not sure where you are trying to display it? Can you elaborate a little?

Anonymous
Not applicable
Author

you are talking about max(Date) only, like this?

=sum({<Sale_Date={'$(=Max(Sale_Date))'},Product={'Product 1'}>} Sales)

/

Count({<Sale_Date={'$(=Max(Sale_Date))'},Product={'Product 1'}>} Sales)

It will give you max date values only

Anonymous
Not applicable
Author

also make sure format of both Sale_Date and =Max(Sale_Date)) should be same

Not applicable
Author

Hi Sunny T,

I am trying to achieve want was done this:

Display data point values on line chart

Re: Display data point values on line chart

John WitherspoonGuru

The reason the legend is displaying "Value" twice is that I stated one of the instructions VERY poorly.  I'd said "Only display data values on the second expression."  I really meant two things by this - on the first expression, do not display data values, and on the second expression, ONLY display data values.  In other words, remove the checkmark next to "Line" for the second expression.  I definitely should have written that differently.

The example is also using a variable, which I wouldn't bother with, and the example fails when you don't select any date.  You can fix that by changing the expression to what I said to use, which in the context of this example would be this:

if(Date=max(total Date),Value)

Heh, nope.  One minor error.  It's displaying the nulls as '-'.  I didn't expect that.  So change it to a space, I guess:

if(Date=max(total Date),Value,' ')

That works.  Thanks for building the example, Erika.

Edit:  Oops, I didn't remove the variable like I suggested.  I've updated the attachment to do so.  Here's the new expression for Value:

sum({<Date={"<=$(=max(Date))"}>} Value)

Not applicable
Author

Hi Balarj,

Your suggestion worked. The only issue is other data points are showing dash ("-") . Please how can I remove this?

Anonymous
Not applicable
Author

Try suppress null values under dimension tab

Not applicable
Author

Hi, suppressing null values did not work.

sunny_talwar

Would you be able to share a screenshot of what you are seeing right now?

Anonymous
Not applicable
Author

Agree with Sunny, share a snapshot or sample, if possible?