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

Announcements
Join us to spark ideas for how to put the latest capabilities into action. Register here!
cancel
Showing results for 
Search instead for 
Did you mean: 
shamsu_mk
Creator
Creator

Avoid repeatation in formula

Dear team

Below I have mentioned a formula where I am dividing one formula with another formula. There is one condition is MonthNMum-='01'. Can we change the formula where I will use MonthNum only one time

=(Sum({<[Exec P&L Heading] = {'Gross Profit'},MonthNum={'01'} ,Year ={$(=max(Year))}>}Amount)*-1)

/

(Sum({<[Exec P&L Heading] = {'Revenue'},MonthNum={'01'} ,Year ={$(=max(Year))}>}Amount)*-1)

I need formula something similar to mentioned below.

MonthNum='01" then (Sum({<[Exec P&L Heading] = {'Gross Profit'},Year ={$(=max(Year))}>}Amount)*-1)

/

(Sum({<[Exec P&L Heading] = {'Revenue'},Year ={$(=max(Year))}>}Amount)*-1)

BR

SHamsu

 

1 Reply
jfkinspari
Partner - Specialist
Partner - Specialist

You could explore the use of calling the formel as a function using a parameter, where the parameter is the MonthNumber. That way you only need to set the MonthNumber once when calling the function.