Qlik Community

New to QlikView

Discussion board where members can get started with QlikView.

Announcements
Modernize Your QlikView Deployment webinar, Nov. 3rd. REGISTER
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Contributor III
Contributor III

maximum number of multiple values in set analysis

Hi All

 

Could some one please explain what is the maximum number of values we can pass into a dimension in set analysis?

and could explain what went wrong at following.?

I am using this expression to get all the list of values over a dimension called SalesKey.

=concat(distinct Aggr(max(SalesKey),Buyer,CPO),chr(39)&','&chr(39))

out put : a list of values

clipboard_image_0.png

but when i use the same expression in set analysis it gives the output as 0.

=Sum ( {< SalesKey = {'$(=concat(distinct Aggr(max(SalesKey),Buyer,CPO),chr(160)&','&chr(160)))'}>} SALES)

1 Solution

Accepted Solutions
Highlighted
Contributor III
Contributor III

Hi Tresesco

Thank you for making me understood on how chr() works and how it can be used in set analysis.
Anyway i managed to use the same expression i wrote initially to get the correct output. the only thing i did was i changed the length of the SalesKey only upto maximum 4 letters. then the same functions worked. i guess there is a limitation of character length what we can provide within quotes. correct me please if i am wrong.

View solution in original post

8 Replies
Highlighted
Specialist II
Specialist II

I believe its due to the quotes encoding the ',' .

Also try to save the concatenated result in a variable and pass the variable in set analysis , that makes it easier to understand and use.

Also check for valid values on the Sales Key passed in set analysis

Highlighted
MVP
MVP

You are missing starting and ending quotes. Try like:

 

chr(39) & concat(distinct Aggr(max(SalesKey),Buyer,CPO),chr(39)&','&chr(39)) &chr(39)

Highlighted
Partner
Partner

Maybe try by using just max(SalesKey) without Aggr:

Sum ( {< SalesKey = {"=max(SalesKey)"}>} SALES)

 

Highlighted
Contributor III
Contributor III

hi Tresesco

can you pls explain how this chr() works here?

Highlighted
MVP
MVP

It's not about chr() as a function. But about understanding your concat() anf it's separator you are using. Your are using chr(39)&','&chr(39) as separator which is essentially - ',' . That means concat would return something like:

value1','value2','value3...','valuen

however, in set analysis modifiers the comparison values expected to be withing single quotes. For ex, <Country={'USA', 'UK', 'FRANCE'}>. Now you look at the returned by your concat() has all quotes for values except the first and last one, and that is because your expression. To fix the missing quotes, try using my expression.

Highlighted
Contributor III
Contributor III

Hi Tresesco

Thank you for making me understood on how chr() works and how it can be used in set analysis.
Anyway i managed to use the same expression i wrote initially to get the correct output. the only thing i did was i changed the length of the SalesKey only upto maximum 4 letters. then the same functions worked. i guess there is a limitation of character length what we can provide within quotes. correct me please if i am wrong.

View solution in original post

Highlighted
MVP
MVP

I see your point. It might work without those quotes because your expression evaluation itself is enclosed by quotes.

There might be a limit in length (I am not sure though), but would not be anything less than hundred elements (if not more) I believe (I never tested though). How many values - in your case? Could you share a sample that shows the issue? 

Highlighted
Digital Support
Digital Support

Hey guys, adding a Design Blog post on Set Analysis, not sure if it may provide some further clarity or not:

https://community.qlik.com/t5/Qlik-Design-Blog/A-Primer-on-Set-Analysis/ba-p/1468344

There are some other links in the post as well to other related posts.  I check the Help as well, but I did not see anything related to limitations...

Regards,
Brett

To help users find verified answers, please do not forget to use the "Accept as Solution" button on any post(s) that helped you resolve your problem or question.
I now work a compressed schedule, Tuesday, Wednesday and Thursday, so those will be the days I will reply to any follow-up posts.