Skip to main content
Announcements
See why Qlik is a Leader in the 2024 Gartner® Magic Quadrant™ for Analytics & BI Platforms. Download Now
cancel
Showing results for 
Search instead for 
Did you mean: 
upaliwije
Creator II
Creator II

add calculated field

Hi,

I have in my excel sheet used for QV documents the following Fields (except new field)

class  Gross Profit   Direct Exp   Direct Income   New Field

A       100                 30              10                    80

B       200              100                50                  150

C        300               150              100                250

I want to create this new field (Gross Profit-Direct Exp+Direct Income) hilighted above either in load script or expression and my output report(pivot table) should look like above.

Pls help to fullfil my requirement

18 Replies
upaliwije
Creator II
Creator II
Author

Tks Sunny

I can mange it thuogh I do not understand it fulyy. One more help pls. If I want to a column in between as below shown  How should I do it

   

CLASSDescriptionGROSS PROFITDirect ExpensesGP after DEExpense1Expense2Direct  IncomeNET Profit
A2,956,8651,177,6851,779,1801,545,0081,588,282293,962-1,060,148
B413,13590,591322,544118,847122,17625,631107,153
C388,048362,36525,683475,387488,70276,364-862,042
D4,601,248362,3654,238,883475,387488,702128,6843,403,478
sunny_talwar

Since you wanted to add two additional columns, I changed the approach by using an Island table approach. Also, your sample had two spaces between Direct and Income and that is why the numbers were not matching earlier.

Capture.PNG

upaliwije
Creator II
Creator II
Author

Thanks a lot

But in my document I dont see the result. Pls check and my Attachment and correct me please

sunny_talwar

You did not make the change on the dimension tab and I am guessing you would have not looked on the sort tab also?

sunny_talwar

You have way too many description values for me to fix the sort tab, but here is the dimension fixed

Capture.PNG

upaliwije
Creator II
Creator II
Author

I cant understand pick dim expression. How can I decide how may Dim values should be there . In this case you have put 1,2.,3 . How does it work? pls explain

sunny_talwar

So you need 1 for your description and for every new column you need to add, add 1 to Dim. So, if we just had to add NET Profit and GP after DE, I would have had a Dim of 1, 2, 3. If you wanted to add 5 new columns, Dim would be 1, 2, 3,4 ,5, 6

Does this make sense?

upaliwije
Creator II
Creator II
Author

Thanks Sunny,

You helped me so much and I learned a lot. Look forward to your help in future as well

Regards

sunny_talwar

I am glad I was able to offer help. I would request you to mark any helpful response as they might come in handy for others in the future.

Qlik Community Tip: Marking Replies as Correct or Helpful

Best,

Sunny