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

expression issue

Hi, I need help to solve this problem:

This expression in a text object returns th max date wich exists data of Group

=max({<Group-={''}>} %Date)

But if I use that as a calculate dimension in my chart, doesn´t work I don´t know why

=if(GetSelectedCount(%Date) <= 0, max({<Group-={''}>} %Date), %Date)

Regards,

Chema

2 Replies
Anonymous
Not applicable

You'll likely need to aggr() this over some field value.

For example, if you have multiple %Date values for your expression, which one should show?

chematos
Specialist II
Specialist II
Author

Hi Johannes

Sorry but I don´t know if I understand your point.

If I use %Date as dimension, my dimension will show me in the chart all the possible dates, doesn´t matter if is one or a lot. If I select a %Date, will show me that date in every rows, but if I want the maximum date when there is no date selected, I need to calculate my dimension %Date to get this behavior and that´s what I´m trying.

=if(GetSelectedCount(%Date) <= 0,

//No dates selected, is the initial state, no filters.

then max({<Group-={''}>} %Date),

//Get max(%Date) where a Group exists, I think that this returns only a date. This is what you were referring before?It´s unknown what Date must be returned??

else %Date)

//dimension %Date, all the values

I need to use aggr(max({<Group-={''}>}%Date),Group,%Date)   ???

I can´t try it right know, that´s why I´m asking for instead trying and telling you if it works.

Thank´s