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

Announcements
Join us to spark ideas for how to put the latest capabilities into action. Register here!
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Display Current Month Selected

I have a line graph that displays all months selected and also a test box that should only display the amount for the most recent month selected.  What is the expression that could make this work?

Here is what I have but it is pulling YTD not just the amount in the last month.

Sum({$<[acct month] = {$(=Max([acct month]))},[acct year] = {$(=Max([acct year]))} , [acct month] = >} [trans amt])

1 Solution

Accepted Solutions
jonathandienst
Partner - Champion III
Partner - Champion III

Hi

I suspect that the second assignment for [acct month] is overriding the first. Try

Sum({$<[acct month] = {$(=Max([acct month]))},[acct year] = {$(=Max([acct year]))}>} [trans amt])

This expression assumes that [acct month] is a numeric field with the month number.

Hope that helps

Jonathan

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

View solution in original post

3 Replies
Sokkorn
Master
Master

Hi,

Maybe you can consider this function:

GetFieldSelections (FieldName [, ValueSep [, MaxValues]])  -> Returns a string with the current selections in a field. ValueSep is the separator to be put between field values. The default is ', '.

Maxvalues is the maximum number of field values to be individually listed. When a larger number of values is selected the format 'x of y values' will be used instead. The default is 6.

Examples

getfieldselections ( Year )

getfieldselections ( Year, '; ' )

getfieldselections ( Year, '; ' , 10 )

Regards,

Sokkorn

jonathandienst
Partner - Champion III
Partner - Champion III

Hi

I suspect that the second assignment for [acct month] is overriding the first. Try

Sum({$<[acct month] = {$(=Max([acct month]))},[acct year] = {$(=Max([acct year]))}>} [trans amt])

This expression assumes that [acct month] is a numeric field with the month number.

Hope that helps

Jonathan

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

That worked! Thank you!