Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
 Koen_D
		
			Koen_D
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		Hi Qlik experts,
I'm looking to use GetFieldSelections with a set analysis to only get certain values the user has filtered, not all of them.
The user can select several KPI's with fieldname KPI_Description. I want to display the selections but only of a certain source, like KPI_Source = 'SAP'. Example:
Example:
LOAD * INLINE [
KPI_Description, KPI_Source
Margin, SAP
Sales, SAP
Customers, SF
];
If the user selects Margin, Sales, and Customer in the field KPI_Description, I want to get Margin, Sales from this function.
Using GetFieldSelections(KPI_Description) I get Margin, Sales, Customer as result. How can I add set analysis to this function?
 
					
				
		
 marcus_sommer
		
			marcus_sommer
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		It was just an example to grab the current selection by adding extra conditions. Just change it to:
concat({< Source = {'SAP'}>} KPI, ',')
to fetch the selected KPI's.
 
					
				
		
 marcus_sommer
		
			marcus_sommer
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		Getfieldselections() isn't very suitable within a set analysis. Better is often the use of concat(distinct ...) and even more easier is the usage of p() and e(). For example:
sum({< KPI = p({< Source = {'SAP'}>} KPI)>} Value)
 Koen_D
		
			Koen_D
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		Thanks for the quick reply Marcus. Perhaps I should have been more clear. I want to use the selected fields to incorporate in a button that navigates to a URL of a different Qlik app in our organisation. The new app should already have the same filters applied as the original app. This is possible by adding the selections to the URL. However, the new app doesn't have all the KPI_Description values that are present in the original app, as that one only contains SAP data. Now, if a user selects the Margin as KPI_Description, it will navigate to the other app with Margin already selected. However if the user selects both Margin and Customer as KPI_Description, the new app doesn't have Customer as KPI_Description as it only contains SAP data, and it will give an error. Therefore I don't need to do a sum of any value, I just need the list of selected values of KPI_Description where KPI_Source = 'SAP'.
 
					
				
		
 marcus_sommer
		
			marcus_sommer
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		It was just an example to grab the current selection by adding extra conditions. Just change it to:
concat({< Source = {'SAP'}>} KPI, ',')
to fetch the selected KPI's.
 Koen_D
		
			Koen_D
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		Thanks, I didn't know about the concat function! Awesome, this works perfectly!
