Qlik Community

Qlik Sense App Development

Discussion board where members can learn more about Qlik Sense App Development and Usage.

Highlighted
nasjw3255
New Contributor II

Total function and set expression exclusions

Hi all,

I am trying to get a total count of products so that I can divide consumption to calculate a consumption per product.

I want to display graphically versus month/year, product type, and day.  I do not want the count to change when I make a selection on the type of material I am trending.

i.e. if I want to see the consumption per total products for material xyz, I want to be able to select xyz and not have the count of products change to only products where xyz is used. (if it is used it has a value, if it was not, it is null).

here is the current code I am using to get the count of products.

count({<[Material.Description]=,[File1.MaterialCode]=,[File2.MaterialCode]=, Material Code Master Key=,[File3.GroupCodeDescription]=,[File3.GroupCode]= ,[File4.ElementCode]=,[File4.ElementCodeDescription]=>}total <MonthYear,[ProductGroup],Day> Distinct [ProductId])

I am using set expressions to try to prevent the count from changing based on material type selection.

Here are the problems I am having

1) If I do not use the Material code Key in my set expression or my filter pane, then the value changes when I make a selection on file1.materialcode

     (i.e. this month I have 30 products, when I don't include the key field and I select on File1.materialcode  i end up with 26 products)

2) When I make a selection on File3.GroupCode, the heat count changes even though I am telling it not to in the set expression.

     (i.e. this month I have 30 products, when I make a selection on File3.groupcode I get 10 products)

Ultimately I would like the count of products to be 30.

Any Ideas on what i can do differently to get my desired result?

5 Replies
MVP
MVP

Re: Total function and set expression exclusions

So, are you saying that even though you ignore selection within set analysis, the selection in those fields filter your expression?

Digvijay_Singh
Honored Contributor III

Re: Total function and set expression exclusions

Your data model is allowing somehow reducing the data based on your selections, you may want to analyse how your associations are created and may need to include some more fields to disregard in set expression. Try {1} if you want to disregard everything.

nasjw3255
New Contributor II

Re: Total function and set expression exclusions

That is correct

nasjw3255
New Contributor II

Re: Total function and set expression exclusions

The problem is that I do not want to disregard everything.  There are fields not related to the graphical analysis that need to have the product count updated.  (product type or production line being examples). 

MVP
MVP

Re: Total function and set expression exclusions

That is strange, would you be able to share a sample where you can show the issue?