
Re: Logic with set of rules
Neha Deshmukh Dec 7, 2017 4:26 AM (in response to nareshthavidishetty nareshthavidishetty)How is it possible that denominator i.e count(TransID) has negative values?

Re: Logic with set of rules
nareshthavidishetty nareshthavidishetty Dec 7, 2017 4:28 AM (in response to Neha Deshmukh )Hi,
This is sample logic.
Lets say
Logic:
(Sum(sales)/count(parts))*1000000
Thanks..

Re: Logic with set of rules
Neha Deshmukh Dec 7, 2017 4:32 AM (in response to nareshthavidishetty nareshthavidishetty)Can you post some sample data?
Because might be i'm not getting your point. What i'm thinking is if you are counting Parts it will be 1,2,3... etc not in negative.



Re: Logic with set of rules
Anil Babu Dec 7, 2017 4:27 AM (in response to nareshthavidishetty nareshthavidishetty)
Re: Logic with set of rules
Anil Babu Dec 7, 2017 4:32 AM (in response to Anil Babu )May be these?
1) If((Sum({<Sales = {"=Sum(Sales)>0"}>} Sales)/Count({<TransID = {"=Count(TransID) = 0"}>}TransID)),(Sum(Sales)/Count(TransID))*100000)
2) If((Sum({<Sales = {"=Sum(Sales)=0"}>} Sales)/Count({<TransID = {"=Count(TransID)=0"}>} TransID)), 0)
3) If((Sum({<Sales = {"=Sum(Sales)=0"}>} Sales)/Count({<TransID = {"=Count(TransID)<=0"}>} TransID)), 0)
4) If((Sum({<Sales = {"=Sum(Sales)>0"}>} Sales)/Count({<TransID = {"=Count(TransID)<=0"}>} TransID)), (Sum(Sales)/Count(TransID))*1000000)


Re: Logic with set of rules
Jonathan Dienst Dec 7, 2017 4:38 AM (in response to nareshthavidishetty nareshthavidishetty)To handle your first two rules:
=Alt(Sum(Sales) / Count(TransID) * 1E5, If(Sum(Sales) = 0, 0, 1E6))
Dividing by zero would trigger the second part of the Alt().
The last two rules could never happen as Count() cannot produce a negative value.

Re: Logic with set of rules
nareshthavidishetty nareshthavidishetty Dec 7, 2017 4:49 AM (in response to nareshthavidishetty nareshthavidishetty)Hi,
Please find the attached sample data set.
Thanks..

Sample.xls 21.5 K

Re: Logic with set of rules
Neha Deshmukh Dec 7, 2017 5:20 AM (in response to nareshthavidishetty nareshthavidishetty)Please find the attached file as per data you have provided.
But here as per logic provided in sample data, Condition 1,2,and 3 will be always 0 because for condition 1 denominator is 0 and condition 2 & 3 rate is 0.

Inline.qvw 153.5 K

Re: Logic with set of rules
nareshthavidishetty nareshthavidishetty Dec 7, 2017 6:18 AM (in response to Neha Deshmukh )Please provide logic.
I don't have access to open external Apps.
Thanks..

Re: Logic with set of rules
Neha Deshmukh Dec 7, 2017 6:21 AM (in response to nareshthavidishetty nareshthavidishetty)1. If(Sum(Notifications)>0 and sum([Item Movement])=0, (Sum(Notifications)/sum([Item Movement]))*100000)
2.If(Sum( Notifications)=0 and sum([Item Movement])=0, (Sum(Notifications)/sum([Item Movement]))*0)
3.If(Sum( Notifications)=0 and sum([Item Movement])<0, (Sum(Notifications)/sum([Item Movement]))*0)
4.If(Sum( Notifications)>0 and sum([Item Movement])<0, (Sum(Notifications)/sum([Item Movement]))*1000000)




Re: Logic with set of rules
nareshthavidishetty nareshthavidishetty Dec 7, 2017 6:33 AM (in response to nareshthavidishetty nareshthavidishetty)Hi,
Thanks for the try.
I belive its not what i required.
Kindly find the below set of rules.
1. If the numerator is greater than zero, but the denominator is zero, then the Sales rate is set to 1,000,000. 2. If the numerator and denominator are both zero, then the Sales rate is zero. 3. If the denominator is negative and the numerator is 0, then the Sales rate is set to 0. 4. If the denominator is negative and the numerator is greater than zero, then the Sales rate is set to 1,000,000. Thanks..

Re: Logic with set of rules
nareshthavidishetty nareshthavidishetty Dec 7, 2017 7:20 AM (in response to nareshthavidishetty nareshthavidishetty)Hi All,
I belive got the answer.
if(sum(Notifications)>0 and sum([Item Movement])=0,1000000,
if(sum(Notifications)=0 and sum([Item Movement])=0,0,
if(sum(Notifications)=0 and sum([Item Movement])<0,0,
if(sum(Notifications)>0 and sum([Item Movement])<0,1000000,
(sum(Notifications)/sum([Item Movement])*1000000)))))
Is there any way to get same results with out using 'IF' condition.
I would be really great..
Thanks..

Re: Logic with set of rules
nareshthavidishetty nareshthavidishetty Dec 8, 2017 4:21 AM (in response to nareshthavidishetty nareshthavidishetty)Hi,
Any other approach.
Thanks..

Re: Logic with set of rules
Neha Deshmukh Dec 8, 2017 6:50 AM (in response to nareshthavidishetty nareshthavidishetty)You can do this by calculating this logic to script level.
