Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
ali_hijazi
Partner - Master II
Partner - Master II

a reduction question

I'm comparing net sales of a salesman to total net sales and the result is fine

However now we are reducing the document by salesman so total net sales will be that of the salesman

How can I reduce a document by salesman and keep total sales?

I can walk on water when it freezes
6 Replies
sunny_talwar

reducing using section access you mean?

Miguel_Angel_Baeyens

You need to preaggreate in the script so the total overall is always there and each salesman can see it, but they cannot see the details. Usually a LOAD ... GROUP BY ... will work.

tresesco
MVP
MVP

Create an additional column with total sale. May be like:

Temp:

Load

          State,

          Sales,

          Customer

From <>;

Join

Load

          State,

          Sum(Sales) as TotalSales

Resident Temp group By State;

ali_hijazi
Partner - Master II
Partner - Master II
Author

yes

I can walk on water when it freezes
ali_hijazi
Partner - Master II
Partner - Master II
Author

I thought of this but at first I thought there might be another workaround

I can walk on water when it freezes
Miguel_Angel_Baeyens

There is none, data must be there and cannot be reduced or accomplished using Aggr() or Set Analysis because data is not actually there.

Well, you can also add another column while extracting from the source but that likely means repeated values, and you can also do the aggregation in the SQL statement, and not the LOAD statement, from the performance point of view the latter is wiser.