Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
pani
Contributor
Contributor

Display top 10 records on Pivot table and line chart

Hi all,

I have  sales data file contains Store, Product, order, id, Time_period(1week, 1month, 3Month) information. Need to display top 10 orders sales details Time_period wise( 1Week, 1Month, 3Month) in Pivot and Line chart.

when I tried, data is getting summing up at product level but  need to show top 10  sales records at order level.

Please advise.

 

 

Labels (4)
1 Solution

Accepted Solutions
pani
Contributor
Contributor
Author

Thanks Anil and Sidhiq for your response, I am able to resolve it by giving ranking using auto number in script. Can I ask you u similar kind of question that I want to create  two tables, one is for sorting ascending order and another table  for descending order using below inline table, when i tried the second table behaving like  table1(FinalTable) even I changed orderby to desc to 2nd table(FinalTable1). please suggest.

Table:
LOAD * INLINE
  [
  MONTH, SALESMAN, SALES_VALUE
  201501, BEN, 10
  201501, ANN, 20
  201501, JAC, 5
  201502, BEN, 100
  201502, ANN, 20
  201502, JAC, 50
  201503, BEN, 5
  201503, ANN, 20
  201503, JAC, 1
  ];
  
FinalTable:
LOAD *,
AutoNumber(SALES_VALUE, MONTH) as RANK
Resident Table
Order By MONTH, SALES_VALUE desc;
 
FinalTable1:
QUALIFY*;
LOAD *,
AutoNumber(SALES_VALUE, MONTH) as RANK
Resident Table
Order By MONTH, SALES_VALUE asc;
//
DROP Table Table;

 

View solution in original post

3 Replies
Anil_Babu_Samineni

Can we have dummy data to understand more?

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
sidhiq91
Specialist II
Specialist II

@pani  Could you please provide some sample data?

pani
Contributor
Contributor
Author

Thanks Anil and Sidhiq for your response, I am able to resolve it by giving ranking using auto number in script. Can I ask you u similar kind of question that I want to create  two tables, one is for sorting ascending order and another table  for descending order using below inline table, when i tried the second table behaving like  table1(FinalTable) even I changed orderby to desc to 2nd table(FinalTable1). please suggest.

Table:
LOAD * INLINE
  [
  MONTH, SALESMAN, SALES_VALUE
  201501, BEN, 10
  201501, ANN, 20
  201501, JAC, 5
  201502, BEN, 100
  201502, ANN, 20
  201502, JAC, 50
  201503, BEN, 5
  201503, ANN, 20
  201503, JAC, 1
  ];
  
FinalTable:
LOAD *,
AutoNumber(SALES_VALUE, MONTH) as RANK
Resident Table
Order By MONTH, SALES_VALUE desc;
 
FinalTable1:
QUALIFY*;
LOAD *,
AutoNumber(SALES_VALUE, MONTH) as RANK
Resident Table
Order By MONTH, SALES_VALUE asc;
//
DROP Table Table;