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

Set Analysis - Adding to current selection

= sum (

    {<

        Time= { ">= $(vminWeek) <= $(vmaxWeek) "},

        Product = Product  + { 'IndustryMin' }

    >}

    Rating)

I have a line graph (chart) with Time as the dimension and the above as my expression.

I have a listbox for Product.

I want the chart so show the selected Product, PLUS another item that was not selected from that listbox.

Therefore I included this in my set analysis: Product = Product  + { 'IndustryMin' }.

If I don't include the filter on Product, my chart filters on Time just fine.

What's wrong with my Product filter?

1 Solution

Accepted Solutions
swuehl
MVP
MVP

I think you can use either method,

try something like

= sum (

    {<

        Time= { ">= $(vminWeek) <= $(vmaxWeek) "},

        Product = p(Product)  + { 'IndustryMin' },

        Product_Display=

    >}

    Rating)

or use your original expression and in your list box a field expression (an expression is available to enter at the bottom of the field list in general tab of the list box):

=if(Product <> 'IndustryMin', Product)

View solution in original post

4 Replies
swuehl
MVP
MVP

I assume that IndustryMin is a value from field Product, right?

I don't see anything wrong with the Product set modifier.

What do you see if you apply above expression?

Have you tried (just as a test) just assigning your IndustryMin value to Product, like

= sum (

    {<

        Time= { ">= $(vminWeek) <= $(vmaxWeek) "},

        Product = { 'IndustryMin' }

    >}

    Rating)

Not applicable
Author

Hi Suwehl,

Yes, IndustryMin is a value from the field Product.

After double-checking using your method, I realized that this is part of a structural issue.

Product_Display,                    Product,               Rating

---------------------------------------------------------------------------------------

GameBoy,                              GameBoy             9

GameGear,                             GameGear           10

SegaSaturn,                           SegaSaturn           5

-                                            IndustryMin           4

The Set Analysis formula Product += {'IndustryMin'} worked,

but the problem was that the listbox shown to users is using the field Product_Display instead of Product.

If I select from the listbox Product_Display, IndustryMin would show up.

If I select from the listbox Product, IndustryMin does not show up.

Would it be possible to hide certain values like IndustryMin from the listbox Product? Then I can just get rid of the field Product_Display!

Otherwise, is there a way to let the dashboard user select from Product_Display, and still be able to use the set analysis += {'IndustryMin'} on Product?

swuehl
MVP
MVP

I think you can use either method,

try something like

= sum (

    {<

        Time= { ">= $(vminWeek) <= $(vmaxWeek) "},

        Product = p(Product)  + { 'IndustryMin' },

        Product_Display=

    >}

    Rating)

or use your original expression and in your list box a field expression (an expression is available to enter at the bottom of the field list in general tab of the list box):

=if(Product <> 'IndustryMin', Product)

Not applicable
Author

Hi Swuehl,

That worked like a charm.

I didnt know p() was so useful.

Thanks!