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: 
Anonymous
Not applicable

If condition with only()

hey all,

I am facing a problem with Rolling 12 months bar chart. I want the chart to show the avg for each month(for 12 month from the month selected). And default to the latest month for which the data is available(If no month/year is selected). The following is my expression :

If(GetSelectedCount([Month ])=0 and GetSelectedCount([Year ])=0,

Only({$<MonthYearID={"<= $(=$(vMax)) >= $(=$(vMax)-11)"},Location = {$(=SubField(GetfieldSelections(Location),':',-1))} >}R_AvgCardSwipes),

Only({$<MonthYearID={"<= $(=max(MonthYearID)) >= $(=max(MonthYearID)-11)"},Location = {$(=SubField(GetfieldSelections(Location),':',-1))} >}R_AvgCardSwipes))

The Only() expressions works fine when alone but not when used with the if condition.

Thanks .

11 Replies
Anonymous
Not applicable
Author

yes Sure.

sunny_talwar

Great

If you got what you were looking for, I would suggest closing this thread by selecting a correct answer and any helpful answers.

Best,

Sunny