Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

sofiavaz
Contributor

Filter not working well

Hi all,

I have a very low level question but i'm not being able to solve it…

In order to build a bar chart I wrote this expression

sum({<ProdmktOrc={"CA*", "C1*", "C6*", "C7*"}, OrdItemMillAlloc={'ATF','FIG','SET'}, OrdItemProdCd={*}-{"SHT"},OrdMasterOrdType={'CUST','STOCK-WHSE'}, OrdItemOrdStat={"CONFIRM","COMPLETE","HOLD"}>}if(OrdItemDelDate<>OrdMasterOrdDate, OrdItemOrdKgs))/1000

   

I have two concerns about this:

1. the OrdItemMillAlloc=USA is still available for selection, even though i'm excluding it in the expression. Is this correct? I thought it would apper in dark grew as 'set' and 'VVR'.

2. I cannot display values for only one of the OrdItemMillAlloc. Even  if I select ATF or any other mill, the visualization remais the same without changing values … I thought that I would be able to filter the visualization to analyse only my ATF orders…

I've already done a lot of expressions like this one and they have always worked… I'm not understanding whats happening now.

Any help would be appreciated! Thank you

Sofia

1 Solution

Accepted Solutions
pradosh_thakur
Honored Contributor II

Re: Filter not working well

Hi Sofia

sum({<ProdmktOrc={"CA*", "C1*", "C6*", "C7*"}, OrdItemMillAlloc={'ATF','FIG','SET'}, OrdItemProdCd={*}-{"SHT"},OrdMasterOrdType={'CUST','STOCK-WHSE'}, OrdItemOrdStat={"CONFIRM","COMPLETE","HOLD"}>}if(OrdItemDelDate<>OrdMasterOrdDate, OrdItemOrdKgs))/1000


The above expression will exclude the selection on OrdItemMillAlloc and the corresponding values for 'ATF','FIG','SET' will be shown . Thats what set analysis does and used here.


but if you want to select one from 'ATF','FIG','SET' when you want you can use either from below expressions


sum({<ProdmktOrc={"CA*", "C1*", "C6*", "C7*"}, OrdItemMillAlloc *={'ATF','FIG','SET'}, OrdItemProdCd={*}-{"SHT"},OrdMasterOrdType={'CUST','STOCK-WHSE'}, OrdItemOrdStat={"CONFIRM","COMPLETE","HOLD"}>}if(OrdItemDelDate<>OrdMasterOrdDate, OrdItemOrdKgs))/1000



or



sum({<ProdmktOrc={"CA*", "C1*", "C6*", "C7*"}, OrdItemMillAlloc ={'ATF','FIG','SET'}, OrdItemProdCd={*}-{"SHT"},OrdMasterOrdType={'CUST','STOCK-WHSE'}, OrdItemOrdStat={"CONFIRM","COMPLETE","HOLD"}> * <OrdItemMillAlloc =p(OrdItemMillAlloc)>}if(OrdItemDelDate<>OrdMasterOrdDate, OrdItemOrdKgs))/1000


Learning never stops.
4 Replies
ali_hijazi
Honored Contributor

Re: Filter not working well

point 1 yes even if you are excluding the value USA it will stay as white in the listbox because in list boxes reflect what actually is related and excluded in current selection set of data ; in your expression you are calculating a measure in a different set of data (overwriting what the actual current selection is)

point 2 if you want to show only ATF when you select ATF then you have to modify your expression and write:
OrdItemMillAlloc *={'ATF','FIG','SET'} or you aggregate your expression by OrdItemMilAlloc

hope this helps

sofiavaz
Contributor

Re: Filter not working well

Thank you Ali,

thanks for the explanaition about point 1.

Regarding point 2, I don't want to modify the expression because, by default, I want to the the value for all MillAlloc. The requirement is that, later, I'll maybe want to analyse only one of the millalloc.

pradosh_thakur
Honored Contributor II

Re: Filter not working well

Hi Sofia

sum({<ProdmktOrc={"CA*", "C1*", "C6*", "C7*"}, OrdItemMillAlloc={'ATF','FIG','SET'}, OrdItemProdCd={*}-{"SHT"},OrdMasterOrdType={'CUST','STOCK-WHSE'}, OrdItemOrdStat={"CONFIRM","COMPLETE","HOLD"}>}if(OrdItemDelDate<>OrdMasterOrdDate, OrdItemOrdKgs))/1000


The above expression will exclude the selection on OrdItemMillAlloc and the corresponding values for 'ATF','FIG','SET' will be shown . Thats what set analysis does and used here.


but if you want to select one from 'ATF','FIG','SET' when you want you can use either from below expressions


sum({<ProdmktOrc={"CA*", "C1*", "C6*", "C7*"}, OrdItemMillAlloc *={'ATF','FIG','SET'}, OrdItemProdCd={*}-{"SHT"},OrdMasterOrdType={'CUST','STOCK-WHSE'}, OrdItemOrdStat={"CONFIRM","COMPLETE","HOLD"}>}if(OrdItemDelDate<>OrdMasterOrdDate, OrdItemOrdKgs))/1000



or



sum({<ProdmktOrc={"CA*", "C1*", "C6*", "C7*"}, OrdItemMillAlloc ={'ATF','FIG','SET'}, OrdItemProdCd={*}-{"SHT"},OrdMasterOrdType={'CUST','STOCK-WHSE'}, OrdItemOrdStat={"CONFIRM","COMPLETE","HOLD"}> * <OrdItemMillAlloc =p(OrdItemMillAlloc)>}if(OrdItemDelDate<>OrdMasterOrdDate, OrdItemOrdKgs))/1000


Learning never stops.
sofiavaz
Contributor

Re: Filter not working well

Thank you Pradosh! Both work!!

Community Browser