5 Replies Latest reply: Jul 31, 2012 11:39 AM by Rahul Lakhina

# Adding set analysis to count function

Hello, I have a functioning expression :- count(if(mid(Move_Out_Date,4,2)='08'and (mid(Move_Out_Date,7,4)='2011')and left(Post_Code,4)='SO15','Count'))

I am trying to add a bit of set analysis to this expression and its not liking it, here is what I am trying :-

count(if(mid(Move_Out_Date,4,2)='08'and (mid(Move_Out_Date,7,4)='2011')and left(Post_Code,4)='SO15' and Count({< Installation= {">1"} > } CA),'Count'))

• ###### Re: Adding set analysis to count function

try like

count( {< Installation= {">1"} > }if(mid(Move_Out_Date,4,2)='08'and (mid(Move_Out_Date,7,4)='2011')and left(Post_Code,4)='SO15',CA))

• ###### Re: Adding set analysis to count function

Qlikview didnt like that, error in expression :-

• ###### Re: Adding set analysis to count function

This is spitting out Null '-'

• ###### Re: Adding set analysis to count function

Try: (i believe there is an extra ',' infront of if in you syntax)

count( {< Installation= {">1"} > }if(mid(Move_Out_Date,4,2)='08'and (mid(Move_Out_Date,7,4)='2011')and left(Post_Code,4)='SO15',CA))

• ###### Re: Adding set analysis to count function

spencer,

Two thing to note:

Count({< Installation= {">1"} > } CA) is not a condition. It would always return true.

Count({< Installation= {">1"} > } CA) is a group funtion (not a row level funtion) which is applied on what seems to be applied on a row operation. This doesnt make sense to QV.

If you are trying to validate this at for a dimension then try aggr() function for the new condition. Like

=Count(if(aggr(Count({< Installation= {">1"} > } CA), CA) > 1,

Count(if(mid(Move_Out_Date,4,2)='08'and (mid(Move_Out_Date,7,4)='2011')and left(Post_Code,4)='SO15',1)),0))

Kiran.