Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

HOW TO FIND HIGHEST SELLING PRODUCT

Hi

I want to fetch the product whose sales is highest and store it into a variable. can anyone help. In short I want The name of the product whose rank is 1.

SUJIT

1 Reply
robert_mika
Master III
Master III

t1:

load * inline [

sales,product

1,A

3,B

4,C]

;

temp:

Load Max(sales) as MaxValue Resident t1;

     Let vVariable=FieldValue('MaxValue',1);

    

     t2:

     load product as p

     resident t1

     where sales=$(vVariable);

  Let vVar=FieldValue('p',1);