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
Contributor
Contributor

Sum amount for one customers

Dear all,

I have a table below

ID for Company customer

ID for Personal customer

Sales

111

 

100

111

 

200

 

AAA

50

 

AAA

20

 

BBB

10

 

How can I get a table like this?

ID

Total Sales

111

300

AAA

70

BBB

10

 

Many thanks!

3 Replies
Highlighted
MVP
MVP

load ID_for_company_customer as ID,

          Sum(Sales) as Sales

FROM SalesTable

group by ID_for_company_customer;

concatenate

load ID_for_personal_customer as ID,

          Sum(Sales) as Sales

FROM SalesTable

group by ID_for_personal_customer;

Highlighted
Contributor III
Contributor III

x:load if(isnull(ID_Company_customer)=false(),ID_Company_customer,ID_Personal_customer) as id , sales

resident salestable;

load id , sum(sales)

resident x

group by id;

Highlighted
Digital Support
Digital Support

Did either of the two posts address what you needed for your use case?  If so, be sure you return to your thread and use the Accept as Solution button on the post(s) that helped you get what you needed.  This gives the poster credit as well as lets the other Community Members know what actually worked.  If you are still working on things, and need further assistance, leave an update post with what you still need.

The only additional thing I can offer is a link to the Design Blog area of the Community where you will find hundreds of how-to posts from our internal experts.  You will likely find some posts that will give you some further ideas on how best to approach things.

https://community.qlik.com/t5/Qlik-Design-Blog/bg-p/qlik-design-blog

Regards,
Brett

To help users find verified answers, please do not forget to use the "Accept as Solution" button on any post(s) that helped you resolve your problem or question.
I now work a compressed schedule, Tuesday, Wednesday and Thursday, so those will be the days I will reply to any follow-up posts.