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

Announcements
Mastering Change Data Capture: Read Now
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

FirstSortedValue - ignore selected field

FirstSortedValue(COUNTRY, aggr(
  (
Sum ({1< FLAG = {'MND'},YEAR = {'$(vYear)'},MONTH = {'*'},F_PPP = {'>0'},T_PPP = {0} >} COUNTER)  /
  
sum({1< FLAG = {'MND'},YEAR = {'$(vYear)'} ,MONTH={'*'},F_PPP={'>0'}>} F_CUSTOMER_BASE )
  ),
COUNTRY))

The calculation is made correct. But I need to ignore the selected countries made in the listbox this influences the country returned by the expression.

any suggestions ?

thanks!

BR. Ben

1 Solution

Accepted Solutions
jerem1234
Specialist II
Specialist II

Think you might need a 1 in for firstsortedvalue if you want to ignore all selections or do Country =

Try:

FirstSortedValue({<COUNTRY= >}COUNTRY, aggr(
  (
Sum ({1< FLAG = {'MND'},YEAR = {'$(vYear)'},MONTH = {'*'},F_PPP = {'>0'},T_PPP = {0} >} COUNTER)  /
  
sum({1< FLAG = {'MND'},YEAR = {'$(vYear)'} ,MONTH={'*'},F_PPP={'>0'}>} F_CUSTOMER_BASE )
  ),
COUNTRY))

Or replace <COUNTRY= > with 1

Hope this helps!

View solution in original post

4 Replies
MK_QSL
MVP
MVP

Something like below..

FirstSortedValue(COUNTRY, aggr(
(
Sum ({1< FLAG = {'MND'},YEAR = {'$(vYear)'},MONTH = {'*'},F_PPP = {'>0'},T_PPP = {0},COUNTRY = ,  >} COUNTER)  /
sum({1< FLAG = {'MND'},YEAR = {'$(vYear)'} ,MONTH={'*'},F_PPP={'>0'},,COUNTRY = , >} F_CUSTOMER_BASE )
),
COUNTRY))

Anonymous
Not applicable
Author

I tried that. The 1 in the formula alreay excludes made selections in the calculation.

thanks anyway

jerem1234
Specialist II
Specialist II

Think you might need a 1 in for firstsortedvalue if you want to ignore all selections or do Country =

Try:

FirstSortedValue({<COUNTRY= >}COUNTRY, aggr(
  (
Sum ({1< FLAG = {'MND'},YEAR = {'$(vYear)'},MONTH = {'*'},F_PPP = {'>0'},T_PPP = {0} >} COUNTER)  /
  
sum({1< FLAG = {'MND'},YEAR = {'$(vYear)'} ,MONTH={'*'},F_PPP={'>0'}>} F_CUSTOMER_BASE )
  ),
COUNTRY))

Or replace <COUNTRY= > with 1

Hope this helps!

Anonymous
Not applicable
Author

Thanks!
<COUNTRY= > did the trick