3 Replies Latest reply: Jan 16, 2013 7:14 AM by Jonathan Brough

# Problem with an complex if clausel

I have the following Data:

 Date Time Direct Search ID Origin Color TimeStamp 31.05.2012 23:29 1 0 1205310883 DE blau 31.05.2012 23:29:30 31.05.2012 23:29 1 0 1206010001 DE blau 31.05.2012 23:29:30 31.05.2012 23:29 0 0 DE none 31.05.2012 23:29:13 31.05.2012 23:29 0 0 DE none 31.05.2012 23:29:24 31.05.2012 23:29 0 0 DE none 31.05.2012 23:29:02 31.05.2012 23:29 0 0 DE none 31.05.2012 23:29:03 31.05.2012 23:29 0 1 DE red 31.05.2012 23:29:03 31.05.2012 23:29 0 0 DE none 31.05.2012 23:29:09 31.05.2012 23:29 0 0 DE none 31.05.2012 23:29:13 31.05.2012 23:29 0 1 0 DE red 31.05.2012 23:29:27 31.05.2012 23:29 0 1 DE blau 31.05.2012 23:29:34 31.05.2012 23:29 1 0 DE red 31.05.2012 23:29:51 31.05.2012 23:29 0 1 DE blau 31.05.2012 23:29:54 31.05.2012 23:29 0 0 DE none 31.05.2012 23:29:56 31.05.2012 23:29 0 0 DE none 31.05.2012 23:29:58

I want the following:

I use a chart table to count the following:

if ( ID<>0 and isnull(ID)=0 and(Direct=1 or Search=1),count(ID) ,0)

dimension is date and time. The result from that example should be 2 but I get 0. Any idea what I doing wrong?

• ###### Re: Problem with an complex if clausel

Hallo Markus,

could you display the ID and Count(ID) in the table?

Perhaps the problem is there.

Ciao

Klaus

• ###### Re: Problem with an complex if clausel

is this a case of conductig your tests across the whole set of data, as opposed to at the level of datapoints ?

Try something like:

count(if ( ID<>0 and isnull(ID)=0 and(Direct=1 or Search=1),ID)

Jonathan

• ###### Re: Problem with an complex if clausel

You'll need to embed the condition in the aggregation, not the other way round:

=count( if ( ID<>0 and isnull(ID)=0 and(Direct=1 or Search=1),ID))