Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
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.
Thank you in advance.
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
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
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
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!
Hi there,
Any suggestions?
Thank you.
Hi,
Please try this example.
As rightly said by Nilesh, you can not achieve it by variables.
Try this one and see if it helps