Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
mansi_dv
Contributor
Contributor

Use of maxstring() function

I want an expression like this.

=sum({<[Month] = {"April"}, Year = {"2012-13"}>}Data)

This works correctly but now I want month and year selected by the user from a list. I could have done it with GetFeildSelections() but I am using alternate States and GetFeildSelections() does not work with alternate states. So I used maxstring() function.

Having my state name as 'new', I did it as follows:

=sum({<[Month] = maxstring({[new]} [Month]),[Year] = maxstring({[new] [Year]})>}Data)

=sum({<[Month] = maxstring({[new]} [Month])>*<[Year] = maxstring({[new] [Year]})>}Data)

But its showing "error in set modifier element function name".

Then I tried creating variables for Month and Year as:

vMonth = maxstring({[new]} [Month])  and

vYear = maxstring({[new]} [Year])

still no correct output.

Anybody has a solution for this?

10 Replies
mansi_dv
Contributor
Contributor
Author

Thank you Perumal, your first expression worked correctly. I just have one more query. I am using listboxes to display different years and months. I have created a pivot table which changes its data based upon those selections.

But when I clear my selections, by default I have my pivot table loaded with the data of last values of the listboxes. What can be done for this??