6 Replies Latest reply: May 8, 2013 11:02 AM by Anand Krishna

# using variables in set analysis

Hi there,

I have  a variable (v_on_season) that calculates the number of thansactions that a customer performs in a selected period , eg Q1 2012. and another variable (v_off_season) that calculates the number of thansactions that a customer performs in another selected period , eg Q4 2012.

I want to calculate the number of customers that performed at least one transaction in the first period and at least 100  in the other selected period.

So if customer_id is the calculated field i want to calculate something like this:

count ( {\$< \$(v_on_season) > 0 , \$(v_off_season) >= 100>} customer_id)

Any help would be very appreciated.

• ###### Re: using variables in set analysis

Try this, without set analysis:

count(distinct if(aggr(\$(v_on_season),customer_id)>0 and aggr(\$(v_off_season),customer_id)>=100, customer_id))

I can't be sure if I got it right without knowing the nature of your variables.  In this case I assume that they are text of expressions rather than result of expressions calculations.

Regards,

Michael

• ###### Re: using variables in set analysis

the variable will store only one value hence you cant calculate for each customer.

please share the logic, how u are calculating those variables.

-Nilesh

• ###### Re: using variables in set analysis

Hi,

Try this:

if(\$(v_on_season)>0 and \$(v_off_season) >= 100,count(customer_id))

if it is not working then please share the logic to implement the set analysis.

HTH

Sushil

• ###### Re: using variables in set analysis

Hi there,

The variable for on season  is : count({\$< Season = p[Season1] >} [Transaction Ammount])

and for off season is:  count({\$< Season = p[Season2] >} [Transaction Ammount])

Thank you all for your responses guys!

• ###### Re: using variables in set analysis

Hi there,

Any suggestions?

Thank you.

• ###### Re: using variables in set analysis

Hi,