7 Replies Latest reply: Feb 14, 2012 2:00 AM by Celambarasan Adhimulam

# Question

Hi,

I have this expression: Count(if(Round(Interval(Max(financial_date)-created_date)/30)<6,OrigCustomerNumber,0))

but this is not working, how can I count the customer numbers that fulfill the if condition?

Thank you!

• ###### Question

Hi,

You can achieve this by using sum instead of count..

Sum(if(Round(Interval(Max(financial_date)-created_date)/30)<6,1,0))

Hope it helps

Celambarasan

• ###### Question

another question sir,

I have a calculated dimension:

=if((Year(ProductCreatedDate)=\$(vMaxFinYear) and (ProductCreationMonth= \$(vCurrMonth)) ) and item_type='Sales Inventory',item_description)

my variable \$(vCurrMonth) contains different months depending on the selections made by the user.(can be multiple)

\$(vCurrMonth) = 'Jun' OR 'Jul' OR 'Sep'

but this is not working, why? please do help me on this.

• ###### Question

Hi,

Try with this,

use vCurrMonth = Concat(Distinct ProductCreationMonth,',')

Then

=if((Year(ProductCreatedDate)=\$(vMaxFinYear) and SubStringCount(\$(vCurrMonth),ProductCreationMonth)>0 ) and item_type='Sales Inventory',item_description)

Hope it helps

Celambarasan

• ###### Question

I think substringcount is not the one that i'm looking for because I want to show the data based on the value of vCurrMonth which might be ('Jun' or 'Jul' or 'Aug') or other months based on user selections

• ###### Question

Hi,

What expression are you using for the variable vCurrMonth?

Celambarasan

• ###### Question

=chr(39) & Concat(DISTINCT fin_month_name & chr(39),' or ' & chr(39))

with my current calculated dimension, it only gets the first value

• ###### Question

Hi,

Try using match function.

=if((Year(ProductCreatedDate)=\$(vMaxFinYear) and Match(ProductCreationMonth,\$(vCurrMonth)) ) and item_type='Sales Inventory',item_description)

In condition we cann't compare fieldname ='jan' or 'jul because first it evaluates fieldname='jan' then it take 'jul' as separate expression.

Celambarasan