Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Independent validation for trusted, AI-ready data integration. See why IDC named Qlik a Leader: Read the Excerpt!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Build qvd with a pivot table

Hello,

I have created a pivot table from different source table. I want to build a new source table (qvd) from this pivot table, and add a new empty column?

RGDS.

9 Replies
Not applicable
Author

Hi,

I do it this way:

I run this macro after reaload


sub EXPORT()
set obj = ActiveDocument.GetSheetObject("CH01")
obj.ExportEx "C:\NewSource.qvd", 4
end sub


CH01: PivotTable ID
Now I don't remember which parameter is "4", but you can find in the APIGuide...

Not applicable
Author

sorry! do not understand what you mean with: "and add a new empty column". Why you need to?

Not applicable
Author

Thx very much 🙂

Rgds

Not applicable
Author

i would to add a new col on my pivot table, this col doesn't exist in my source table, i had used inline load table, it work thx

Not applicable
Author

But i have another problem!

I calcul in my pivot table sum of turn over by proudct for every company. i want to add a new colomun wich contain the name of the company with the max turn over.

Not applicable
Author

I do not know if I understood everything right. My English is bad!

you get the data (IdCompany, Sales, ...) from the corresponding source (SQL, XLS). Then, do you want to add the name of the company?

if so, use "join" or "left join" or ... to add the names from another source (inLine, xls, ...)


Table1:
LOAD
CompanyID,
Product,
.
.
.
sum(Sales)
FROM .....
GROUP BY .....;
left join (Table1)
LOAD
CompanyID,
CompanyName
FROM .....;


Not applicable
Author

No! I have this pivot table

Product

Sum turn over

P1

40

For P1: Sum turn over = turn over(company1) + turn over(company2) + turn over(company3)

10 + 20 + 10

I want in my pivot table add column ' Best turn over company' which contain the name of company with max turn over, in my example: company2

New pivot table:

Product

Sum turn over

Best turn over company'

P1

40

company2



sebastiandperei
Specialist
Specialist

Hi,

Add this new expression:

=If (Turn_Over_Comp1 > Turn_Over_comp2      and     Turn_Over_Comp1 > Turn_Over_comp3, 'Company 1',

If (Turn_Over_Comp2 > Turn_Over_comp1      and     Turn_Over_Comp2 > Turn_Over_comp3, 'Company 2' , 'Company 3'))

sebastiandperei
Specialist
Specialist

This was useful for you?