Skip to main content
Woohoo! Qlik Community has won “Best in Class Community” in the 2024 Khoros Kudos awards!
Announcements
Nov. 20th, Qlik Insider - Lakehouses: Driving the Future of Data & AI - PICK A SESSION
cancel
Showing results for 
Search instead for 
Did you mean: 
sona_sa
Creator II
Creator II

Expression Help

Hi,

I have an expression i.e :

=
if(GetSelectedCount(Section1=1),

(If(([P&L Level] = 's' or IsAdjustment = '1'), ' ',Sum({Period_1<CompanyName=$::CompanyName,Department=$::Department,Format=$::Format,Format_Data1=$::Format_Data1,Format_Data2=$::Format_Data2,SourceName=$::SourceName,TransTypeName=$::TransTypeName,Section1=$::Section1>}($(OpenBalanceExpression)+($(DebitExpression)-$(CreditExpression)))))),

If(([P&L Level] = 's' or IsAdjustment = '1') , ' ',sum({Period_1<CompanyName=$::CompanyName,Department=$::Department,Format=$::Format,Format_Data1=$::Format_Data1,Format_Data2=$::Format_Data2,SourceName=$::SourceName,TransTypeName=$::TransTypeName>}($(OpenBalanceExpression)+($(DebitExpression)-$(CreditExpression)))))
)

Where I have to put a condition for OpenBalanceExpression that is :

Sum({$<MonthNum={$(vMinMonth)}>} $(OpenBalanceExpression) )

Only for OpenBalanceExpression

And I have written on variable

OpenBalanceExpression = OpenBal

DebitExpression = Debit

CreditExpression = Credit


Thanks.

2 Replies
Peter_Cammaert
Partner - Champion III
Partner - Champion III

If I get it right, you can go ahead like this:

  1. Divide each Sum({SetAnalysis} OpenBalance + DebitExpr - CreditExpr) sub-expression into three separate subexpressions, like Sum({SetAnalysis} OpenBalance) + Sum({SetAnalysis} DebitExpr) - Sum({SetAnalysis} CreditExpr)Copy the set modifiers to each new subexpression.
  2. Then add the extra set modifier MonthNum={$(vMinMonth)} to the first Sum() only.

Best,

Peter

sona_sa
Creator II
Creator II
Author

Thanks Peter.


I accept the point for the same : Sum({SetAnalysis} OpenBalance) + Sum({SetAnalysis} DebitExpr) - Sum({SetAnalysis} CreditExpr)


Can you help me to make the same expression by using all parameter. I am using alternate states so that I am not able to make it.


My Expression :- 


If(([P&L Level] = 's' or IsAdjustment = '1'), ,Sum({Period_1<CompanyName=$::CompanyName>}($(OpenBalanceExpression)+($(DebitExpression)-$(CreditExpression)))))


Thanks Again.