Skip to main content
Announcements
Qlik Connect 2025: 3 days of full immersion in data, analytics, and AI. May 13-15 | Orlando, FL: Learn More
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Problem with if-request

Dear all,

First I would like to wish you and your families a Merry Christmas

I have a problem. For a Proft & Loss Report, it is neccessary to work with the data from the current year to have plandates for next year. I have the following Table:

Profit and LossFormula20122013
Net Salessum(NETSALES) + Sum(PLANSALES)1.0001.200
Direct Cost of Salessum(DCOS) * -1-450-540
Product Marginsum(NETSALES) + sum(DCOS)*-1550660
Remaining Cost of Salessum(RCOS) * -1-120-144
Gross Profit[Product Margin] + sum(RCOS)*-1430516
Marketing and Selling Expensessum([MS Exp]) * -1-120-138
SG&A Expensessum([SGA Exp])*-1-120-123
R&D Expensessum([RD Exp]) * -1-120-133
EBIT[Gross Profit] - sum([MS Exp]) - sum([SGA Exp]) - sum([RD Exp])70122
TaxesMaxString(TAXES_YTD) * -1-11-17
Interest ExpensesMaxString(INTEREST_YTD) * -1-18-21
NOPATEBIT + Taxes + [Interest Expenses]52101

The numbers from year 2012 are in a Excel Sheet. With the Formula, all the results in 2012 are right. The data for the year 2013 must be calculatet. Only the Plansales for 2013 is given in the Excel Sheet.

Direct Cost of Sales:                       previous year * sales increase

Product Margin:                               Net Sales - Direct Cost of Sales

Remaining Cost of Sales:                 previous year * sales increase

Gross Profit:                                   Product Margin - Remaining Cost of Sales

Marketing and Selling Expenses:      previous year * sales increase/ FTE-increase

SG&A Expenses:                            previous year * sales increase/FTE-increase

R&D Expenses:                               previous year * sales increase /FTE-increase

EBIT:                                              Gross Profit + Marketing and Selling Expenses + SG&A Expenses + R&D Expenses

Taxes:                                            EBIT * rate of taxes * -1

Interest Expenses:                          Dept Capital * interest rate * -1

NOPAT:                                         EBIT + Taxes + Interest Expenses

So I changed the formula from Direct cost of Sales to the following formula:

if(YEAR = 2012, sum(DCOS) * -1, sum(DCOS) + (sum(DCOS) * (vAMOUNT2013 - vAMOUNT2012)/100))

vAMOUNT2012 = sum({$ <YEAR = {2012}>}NETSALES)

vAMOUNT2013 = sum({$ <YEAR = {2013}>}PLANSALES)

But the formula doesn't work in the if - request. When i try only the second part of the formula in the if-request, the result for 2013 is right.

Can anybody help me, to get the rigth results for 2012 and 2013 in one formula? Or can anybody tell me why the if-request doesn't work?

Would be great to post your idea here, because i cannot open files from another person.

Best Regards,

Kerstin Sophia

0 Replies