Skip to main content
Announcements
July 15, NEW Customer Portal: Initial launch will improve how you submit Support Cases. IMPORTANT DETAILS
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

How to calculate percentage

I have 3 fields.

%Growth,%GrowthCY and TotalFTECY

TotalFTECY=3735

%GrowthCY=100%

%GrowthNY = 3%


now I need to calculate TotalFTENY


So basically it is (3735*3)/100

How can I do this in qlikview?

Thanks much.

11 Replies
sunny_talwar

If they are fields why not do like this in the script:

LOAD [%GrowthNY],

          [%GrowthCY],

          [TotalFTECY],

          ([TotalFTECY] * [%GrowthNY])/100 AS [TotalFTENY]

FROM Source

Not applicable
Author

I tried this and it displays nothing.Thank you.

sunny_talwar

Can you share few lines of data to look at?

Not applicable
Author

Capture.PNG

krishna_2644
Specialist III
Specialist III

do you have anything where its has how growth is calculated?

Not applicable
Author

no..its an excel file

sunny_talwar

Can you store your data like this maybe?

TotalFTECY,    %GrowthNY,    Year

3735,                      3,          2015

Table:

LOAD *,

  ([TotalFTECY] * [%GrowthNY])/100 AS [TotalFTENY];

LOAD * Inline [

TotalFTECY, %GrowthNY, Year

3735, 3, 2015

];

Output:

Capture.PNG

krishna_2644
Specialist III
Specialist III

load TotalFTECY,

     %GrowthCY,

     %GrowthNY,

     (TotalFTECY * purgechar(%GrowthNY,'%'))/purgechar(%GrowthCY,'%') as TotalFTENY

from xyz.xls;

edit:

As there's no %GrowthCY in your excel,

you can also try

load TotalFTECY,

     %GrowthNY,

     (TotalFTECY * purgechar(%GrowthNY,'%'))/100 as TotalFTENY

from xyz.xls;

Not applicable
Author

This is pulling from the share point list and once they add more data it has to update accordingly