Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
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!
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;
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;
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