Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
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.