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: 
TomBond77
Specialist
Specialist

"freeze" calculation

Hi experts

I have this formula, it should be freezed also against filter selection on YearMonth:

Sum(
{<[YearMonth]={"$(='>=' & MonthStart(yearstart(max(YearMonth))) & '<=' & MonthEnd(Max(YearMonth)))"}>}
Quantity)

Any ideas?

Thanks, tom

9 Replies
steeefan
Luminary
Luminary

Try this: Sum({<[YearMonth] = {"$(=(>=MonthStart(YearStart(Max(YearMonth)))<=MonthEnd(Max(YearMonth))))"}>} Quantity).

Make sure that the results given of your inner expression matches the values contained in YearMonth.

TomBond77
Specialist
Specialist
Author

Thanks, but this is not working....it gives zero as result...

Gabbar
Specialist
Specialist

Try theses:-
If you want to freeze against Only YearMonth:-
Sum(
{<[YearMonth]={"$(='>=' & MonthStart(yearstart(max({1}YearMonth))) & '<=' & MonthEnd(Max({1}YearMonth)))"}>}
Quantity)

If you want to freeze against every filter:-

Sum(
{1<[YearMonth]={"$(='>=' & MonthStart(yearstart(max({1}YearMonth))) & '<=' & MonthEnd(Max({1}YearMonth)))"}>}
Quantity)

Ahidhar
Creator III
Creator III

try this

Sum(
{1<[YearMonth]={"$(='>=' & MonthStart(yearstart(max(YearMonth))) & '<=' & MonthEnd(Max(YearMonth)))"}>}
Quantity)

TomBond77
Specialist
Specialist
Author

Thanks, but this is also not working:

Sum(
{<[YearMonth]={"$(='>=' & MonthStart(yearstart(max({1}YearMonth))) & '<=' & MonthEnd(Max({1}YearMonth)))"} >}
Quantity)

TomBond77
Specialist
Specialist
Author

thanks, not working.

 

Ahidhar
Creator III
Creator III

try this

sum({<YearMonth={">=$(=date(Yearstart(max(YearMonth)),'MMM-YYYY')) <=$(=date(max(YearMonth),'MMM-YYYY'))"},YearMonth=>}Quantity)

TomBond77
Specialist
Specialist
Author

Thanks, still not working...it still doesn't ignore the filter selection YearMonth:

 

Sum(
{1<[YearMonth]=
{"$(='>=' & MonthStart(yearstart(max({1}YearMonth),'YYYY-MMM')) & '<=' & MonthEnd(Max({1}YearMonth),'YYYY-MMM'))"} >}
Quantity)

Aasir
Creator III
Creator III

Use TOTAL qualifier 
Sum(
TOTAL
{<[YearMonth]={"$(='>=' & MonthStart(yearstart(max(YearMonth))) & '<=' & MonthEnd(Max(YearMonth)))"}>}
Quantity
)