Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
karensmith
Contributor II
Contributor II

Set Analysis statement not working

Based on user's fiscal quater selection application shold display inventory start amount in one column and end amount in other column. I am not able to get any field values for the below set analysis statments. I don't want to sum values, but to show expression total.

Example user select Q2 FY2009, first statement should display 7/1/2009 and second statment should display 9/1/2009.This based on fiscal calendar starting in April.

Can someone please tell me what is wrong with my syntax?

=({$<

FiscalQuarter = {$(=only(FiscalQuarter))}, FY_QtrStart = {"<=$(=only({<FiscalQuarter={$(=only(FiscalQuarter))}>} FY_QtrStart))>$(=only({<FiscalQuarter={$(=only(FiscalQuarter))}>} FY_QtrStart))"}>} Start_Amount), '$#,##0;($#,##0)'

)

=({$<FiscalQuarter = {$(=only(FiscalQuarter))}, FY_QtrEnd = {"<=$(=only({<FiscalQuarter={$(=only(FiscalQuarter))}>} FY_QtrEnd))>$(=only({<FiscalQuarter={$(=only(FiscalQuarter))}>} FY_QtrEndt))"}>} End_Amount), '$#,##0;($#,##0)'

)





2 Replies
karensmith
Contributor II
Contributor II
Author

I tried using this statment, but I'm not getting sum(startAmount Values:

Sum

({$<FiscalQuarter={$(=maxstring([FiscalQuarter]))},FY_QtrStart ={$(=min([FY_QtrStart]))} >} Start_Amount

)

This expression result:

Sum({$<FiscalQuarter={Q1},FY_QtrStart ={4/1/2009} >} Start_Amount)





karensmith
Contributor II
Contributor II
Author

SUM

({<MonthStart={'>=$(=Min(MonthStart)) <=$(=min(MonthStart))'}>} Start_Amount

)



SUM

({<MonthStart={'>=$(=Max(MonthStart)) <=$(=Max(MonthStart))'}>} End_Amount+EndX_Amount)

I got my statements to work, but now I need to calculate the avg between the set analysis fields. How canI calculate the avg of the two fields?