Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
 slribeiro
		
			slribeiro
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		Greetings.
I want to build an expression that sums all my top 10 Values that are from Sales in a text box and i'm having a problem by having the symbol " inside another ".
The code:
sum({<     Client={"=
 
 sum({<     %ValueType={'Sales'}
 ,YearMonth = {"<=$(=max(YearMonth ))"}
 ,Year={$(=max(Year))}
 >}
 $(v_Value))
 
 >=$(=max(aggr(
 
 sum({<     %ValueType={'Sales'}
 ,YearMonth  = {"<=$(=max(YearMonth))"}
 ,Year={$(=max(Year))}
 >}
 $(v_Value))
 
 ,Client),10))"}
%ValueType={'Sales'}
,YearMonth  = {"<=$(=max(YearMonth))"}
,Year={$(=max(Year))}
 >}
 $(v_Value)
 )
Other ideas are accepted... I just need to create a total to the top 10 on a text box.
If you can help please help me!
Best regards
 
					
				
		
 swuehl
		
			swuehl
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		You might be able to replace the inner pair of double quotes with single quotes:
sum({<     Client={"=
sum({<     %ValueType={'Sales'}
,YearMonth = {'<=$(=max(YearMonth ))'}
,Year={$(=max(Year))}
>}
$(v_Value))
>=$(=max(aggr(
sum({<     %ValueType={'Sales'}
,YearMonth = {'<=$(=max(YearMonth))'}
,Year={$(=max(Year))}
>}
$(v_Value))
,Client),10))"}
%ValueType={'Sales'}
,YearMonth = {"<=$(=max(YearMonth))"}
,Year={$(=max(Year))}
>}
$(v_Value)
)
 
					
				
		
 swuehl
		
			swuehl
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		You might be able to replace the inner pair of double quotes with single quotes:
sum({<     Client={"=
sum({<     %ValueType={'Sales'}
,YearMonth = {'<=$(=max(YearMonth ))'}
,Year={$(=max(Year))}
>}
$(v_Value))
>=$(=max(aggr(
sum({<     %ValueType={'Sales'}
,YearMonth = {'<=$(=max(YearMonth))'}
,Year={$(=max(Year))}
>}
$(v_Value))
,Client),10))"}
%ValueType={'Sales'}
,YearMonth = {"<=$(=max(YearMonth))"}
,Year={$(=max(Year))}
>}
$(v_Value)
)
 slribeiro
		
			slribeiro
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		Thank you.
Stupid me 🙂
 
					
				
		
 swuehl
		
			swuehl
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		No, that's not stupid at all.
According to Henric Cronstroem, the single and double quotes should be handled differently in set modifiers as they are actually.
I usually use double quotes for advanced searches and single quotes for literals, but in cases like yours, it's good that Qlik actually doesn't make a functional difference.
