Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Need Flag...

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.

1 Solution

Accepted Solutions
Not applicable
Author

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;

View solution in original post

6 Replies
Not applicable
Author

For Ex,

load sum(if(aggr(sum(Sales)/Count(Order),Country, Salesperson)<1000,1,0)) as Flag residential sal_ord;



Regards,

Raja.

Not applicable
Author

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;

jonathandienst
Partner - Champion III
Partner - Champion III

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

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein
Not applicable
Author

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.

Not applicable
Author

ya grate, u r think accurate  way ..

Not applicable
Author

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