Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Set Analysis Question

Hello Again,

I am having some difficulty with this set analysis.  It seems to work when I choose other date dimensions like Fiscal Year, YTD, Quarter to date but when I just try and use Date it is not working.
So, why does this expression work:

=sum({<Date={'4/4/2012'}>}[In company code currency_HSL]*-1*RatetoUSD)

And the one I need to work below does not:

=sum({<Date={$(max (Date)) }>}[In company code currency_HSL]*-1*RatetoUSD)

Thanks again

1 Solution

Accepted Solutions
v_iyyappan
Specialist
Specialist

Hi,

Use the expression like this

= Sum({<Datefield={'$(=vMaxDate)'}>}[In company code currency_HSL]*-1*RatetoUSD)

Where vMaxDate = Max(Datefield)

Regards,

Iyyappan

View solution in original post

3 Replies
v_iyyappan
Specialist
Specialist

Hi,

Use the expression like this

= Sum({<Datefield={'$(=vMaxDate)'}>}[In company code currency_HSL]*-1*RatetoUSD)

Where vMaxDate = Max(Datefield)

Regards,

Iyyappan

jonathandienst
Partner - Champion III
Partner - Champion III

Sean

Two possible issues:

  • $(max(Date)) should read  $(=max(Date))
  • $(=max(Date)) returns a number. Set analysis compares on the text representation of the elements and so perhaps this would be better:     $(=Date(max(Date)))

Hope that helps

Jonathan

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein
Not applicable
Author

Thank you.  This example worked where the other preply to my question did not.  Any thoughts as to why it worked using a variable for max date vs the other examples?

Thank you,