Qlik Community

New to QlikView

Discussion board where members can get started with QlikView.

Announcements
Modernize Your QlikView Deployment webinar, Nov. 3rd. REGISTER
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
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
Highlighted
Not applicable

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
Highlighted
Not applicable

For Ex,

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



Regards,

Raja.

Highlighted
Not applicable

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

Highlighted

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
Highlighted
Not applicable

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.

Highlighted
Not applicable

ya grate, u r think accurate  way ..

Highlighted
Not applicable

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