Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi All,
I require flag(1,0) , when customers sales have greater than 1500 than 1 or 0, I creating and using list box using below script, but I need into load script , no need to list box or text box.
=if (Aggr(Sum(Sales_Amt),Customer,Sal_Person )>=1500,1,0)
i am seem to be looking like,
Load if (Aggr(sum(Sales_Amt),Customer,Sal_Person )>=1500,1,0) as flag residential sal_ord;
Regards,
Raja.
hi
try this
NewTable:
Load
sum(Sales_Amt) as Sales_Amt_new,
Customer,
Sal_Person
resident sal_ord
group by Customer,Sal_Person;
outputtable:
load * ,
if (Sales_Amt_new >=1500,1,0) as flag
resident NewTable;
For Ex,
load sum(if(aggr(sum(Sales)/Count(Order),Country, Salesperson)<1000,1,0)) as Flag residential sal_ord;
Regards,
Raja.
hi
try this
NewTable:
Load
sum(Sales_Amt) as Sales_Amt_new,
Customer,
Sal_Person
resident sal_ord
group by Customer,Sal_Person;
outputtable:
load * ,
if (Sales_Amt_new >=1500,1,0) as flag
resident NewTable;
Hi
This will add the flag to the transaction table (modify to fit your data model and requiremments):
Transactions:
LOAD
SaleDate,
Customer,
Value,
SalesPerson,
...
FROM Sales...
JOIN (Transactions)
LOAD Customer,
SalesPerson,
If(Sum(Value) > 1500, 1, 0) As Flag
RESIDENT Transactions
GROUP BY Customer, SalesPerson
;
HTH
Jonathan
Hi Vishwa,
Thanks for your answer . this exactly(correct answer) i am looking
I have small misunderstanding,
Now here, what is the difference between into AGGR and Group by <Column Name>.
Regards,
Raja.
ya grate, u r think accurate way ..
hi
AGGR and Group by both are same meaning, only difference is that,
AGGR uses on front end
Group By uses on back end (In script).
Thanks
Regards