Skip to main content
Announcements
Qlik Introduces a New Era of Visualization! READ ALL ABOUT IT
cancel
Showing results for 
Search instead for 
Did you mean: 
upaliwije
Creator II
Creator II

Calculation in Pivot Table

I have following straight table in my QV document. I have created Column 1 2 4 and want to write expression to create column 3 ,5,6 and 7

My expression for Column No 2 is Sum(Actual) and for  4 is Sum(Budget)

Pls help me to write the expression and my excel sheet is also attached herewith

1234567
DESCRIPTIONACTUALRatioBUDGETRatioRevised VARIENCE
SALES6,695,821 12,659,000 6,695,8210
RETURNS2,349,506352,491,693201,317,9501,031,556
NET_SALES4,346,3156510,167,307805,377,871-1,031,556
COMM_INCOME367,5085278,2702147,187220,321
TOTAL_REVENUE4,713,8237010,445,577835,525,059-811,235
COMM_EXPENSES1,274,026191,673,87013885,373388,653
GROSS_PROFIT3,439,797518,771,707694,639,686-1,199,889
STAFF_EXPENSES1,955,210292,253,692181,192,062763,147
ADMIN_EXPENSES1,617,196241,929,433151,020,550596,647
SELLI_EXPENSES706,72511891,9557471,788234,937
FINAN_EXPENSES317,6975346,6733183,368134,329
DEPRECIATION166,4392172,717191,35775,082
TOTAL_EXPENSES4,763,267715,594,469442,959,1251,804,141
OTHER/INVEST_INCOME2,694,430402,766,285221,463,1921,231,238
NET_PROFIT1,370,961205,943,523473,143,753-1,772,792
3 Replies
its_anandrjs

Write the expression like

Create a variable

Let vSalesVal = //and store the sales values here

Let vBudgetVal = //and store the budget values here

Let vRevisedVal = //and store the revised values here


Dimension:- DESCRIPTION

ACTUAL:- SUM(ACTUAL)

Ratio:- (SUM(ACTUAL) /  $(vSalesVal ))*100

BUDGET:- SUM(BUDGET)

Ratio:- (SUM(BUDGET) /  $(vBudgetVal ))*100

Revised:- ( $(vRevisedVal ) / column(4) ) * 100

VARIENCE :- COLUMN(1) - COLUMN(5)

Hope this helps

upaliwije
Creator II
Creator II
Author

Hi Anand

Thanks a lot You are helping me a lot. What you suggest is not very clear to me. Pls do the modification in the attached QV document, !

its_anandrjs

Another way of doing this with simple ways is.

Create a variable

Let vSalesVal  = Sum( {<DESCRIPTION={'SALES'}>} ACTUAL)

Let vBudgetVal =Sum( {<DESCRIPTION={'SALES'}>} BUDGET)

Let vRevisedVal =Sum( {<DESCRIPTION={'SALES'}>} Revised)


And


Dimension:- DESCRIPTION

ACTUAL:- SUM(ACTUAL)

Ratio:- (SUM(ACTUAL) /  $(vSalesVal ))*100

BUDGET:- SUM(BUDGET)

Ratio:- (SUM(BUDGET) /  $(vBudgetVal ))*100

Revised:- if(RowNo()=1,$(vSALES), $(vREVISED)*Column(4)/100 )

VARIENCE :- Column(1) -Column(5)