Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
slribeiro
Partner - Creator
Partner - Creator

Problem with set analysis inside set analysis

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

1 Solution

Accepted Solutions
swuehl
MVP
MVP

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)
)

View solution in original post

3 Replies
swuehl
MVP
MVP

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
Partner - Creator
Partner - Creator
Author

Thank you.

Stupid me 🙂

swuehl
MVP
MVP

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.