Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I have 1 single table of data in my app.
3 fields of relevance:
Both of those status fields are directly aligned: A =Active, I=Inactive, T=T
So I wanted to count the ShipTo, that are Active.
Was getting some unexpected results, so now testing this 2 ways :
=Count(distinct {$<DlvryStatus={"A"}>} ShipTo)
=Count(distinct {$<LBStatus={"Active"}>} ShipTo)
Both 'should' behave identically.
Both give a correct count with no selections made in the UI. (they count ShipTo that have 'A' or 'Active')
However, if I filter DlvryStatus="I" , the DlvryStatus expression above still gives a value, even though I have explicitly filtered on value 'I' , and the expression should only count when 'A'.
At the same time, the LBStatus expression now reads '0' (correctly)
This works in reverse also: if I filter LBStatus="Inactive", then the LBStatus expression still shows full value, yet the DlvryStatus expression shows '0'.
Maybe I've been at this too long, but these are simple basic expressions that I am struggling to understand what's going on !!
Attaching a Screenshot:
Top 2 boxes on left are text boxes showing Set Analysis Expression with resulting number.
Top 2 boxes on right are filters for the 2 Status fields (filtered on LBStatus="Inactive")
Bottom Left: straight table
Bottom right : Pivot showing mapping between the 2 Status Fields.
Really grateful if someone could point out what I am not seeing here !!
Thanks
That is how the syntax is built. and if you are not looking for this behavior, then there is a work around. To use * before = and now it will honor your selection.
Count({$<DlvryStatus *= {"A"}>} ShipTo)
May be you need this
=Count(DISTINCT {$<DlvryStatus *= {"A"}>} ShipTo) =Count(DISTINCT {$<LBStatus *= {"Active"}>} ShipTo)
I hear you, but confusing/conflicting with the Qlik documentation.
Example :
{$<Year={2009}>}
This set expression contains an identifier $, and the modifier Year={2009}. This example does not include an operator. The set expression is interpreted as: "All records in the current selection that belong to the year 2009".
So if I filter on DlvryStatus='I', using a filter pane, then my 'current selection' no longer contains any 'A' values.
My set expression :
Count( {$<DlvryStatus={"A"}>} ShipTo)
should then give me "All records in the current selection that belong to the DlvryStatus 'A'"
.... and from the previous filter pane action, there are no 'A's to count !
Sorry if I'm circling around the same point ... I just don't get the logic of asking it to count records that match a specific value, but then it counts them even if they are not in the current set !?
That is how the syntax is built. and if you are not looking for this behavior, then there is a work around. To use * before = and now it will honor your selection.
Count({$<DlvryStatus *= {"A"}>} ShipTo)
This really dug me out of a major problem today. Is there anywhere that explains when you'd use +=, -=, *= or /= and what they mean.