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

Set Analysis issue in Text box

Hi Everyone ,

      I am writing the below Expression in Text box. when I select Particular month ,It is giving Correct value .I need the Same value Without Selecting Max month.

My requirement is by default it should show Max Month value.

=Num(Avg(Aggr((((Count({<Attr_Flag = {1}, Cal_Year={'$(vMax_Year)'}, Cal_Month=, Cal_Quarter=, Cal_Date={"<=$(=Max({$<Cal_Year={'$(vMax_Year)'}>}Cal_Date))"} >}Distinct [Employee Code])/
((
Count({$<Cal_Month_Flag={1}, Cal_Year={'$(vMax_Year)'}, Cal_Month={'$(vMax_Month)'}, Cal_Quarter=, [Active Flag DayWise]={1}>}DISTINCT [Employee Code])+$(vTest))/2))/
Count({$<Cal_Year={'$(vMax_Year)'}, Cal_Month=, Cal_Quarter=, [Cal_Month ID]={"<=$(=Max([Cal_Month ID]))"}>}DISTINCT [Cal_Month ID]))*12),Cal_Month)),'#0.00%')

Any Suggestions would be greatly Appreciated.

Regards,

Divya

1 Solution

Accepted Solutions
buzzy996
Master II
Master II

try tis,

=Num(Avg(Aggr((((Count({<Attr_Flag = {1}, Cal_Year={'$(vMax_Year)'}, Cal_Month={'$(vMax_Month)'}, Cal_Quarter=, Cal_Date={"<=$(=Max({$<Cal_Year={'$(vMax_Year)'}>}Cal_Date))"} >}Distinct [Employee Code])/
((
Count({$<Cal_Month_Flag={1}, Cal_Year={'$(vMax_Year)'}, Cal_Month={'$(vMax_Month)'}, Cal_Quarter=, [Active Flag DayWise]={1}>}DISTINCT [Employee Code])+$(vTest))/2))/
Count({$<Cal_Year={'$(vMax_Year)'}, Cal_Month={'$(vMax_Month)'}, Cal_Quarter=, [Cal_Month ID]={"<=$(=Max([Cal_Month ID]))"}>}DISTINCT [Cal_Month ID]))*12),Cal_Month)),'#0.00%')

View solution in original post

7 Replies
settu_periasamy
Master III
Master III

Hi,

Try this,

=Num(Avg(Aggr((((Count({1}{<Attr_Flag = {1}, Cal_Year={'$(vMax_Year)'}, Cal_Month=, Cal_Quarter=,

Cal_Date={"<=$(=Max({$<Cal_Year={'$(vMax_Year)'}>}Cal_Date))"} >}Distinct [Employee Code])/

((Count({1}{$<Cal_Month_Flag={1}, Cal_Year={'$(vMax_Year)'},

Cal_Month={'$(vMax_Month)'}, Cal_Quarter=, [Active Flag DayWise]={1}>}DISTINCT [Employee Code])+$(vTest))/2))/

Count({1}{$<Cal_Year={'$(vMax_Year)'},

Cal_Month=, Cal_Quarter=, [Cal_Month ID]={"<=$(=Max([Cal_Month ID]))"}>}DISTINCT [Cal_Month ID]))*12),Cal_Month)),'#0.00%')

avinashelite

Hi Divya,

Try to add = before all the variables and check once, if still facing same issue please post the app

Anonymous
Not applicable
Author

Try to use ALL function like -

Max(ALL [Dimension])

Hope this helps.

Not applicable
Author

Hi,

Thanks for the response, Still getting the same issue.

settu_periasamy
Master III
Master III

Can you post the sample data?

Anonymous
Not applicable
Author

can you please share qvw..

buzzy996
Master II
Master II

try tis,

=Num(Avg(Aggr((((Count({<Attr_Flag = {1}, Cal_Year={'$(vMax_Year)'}, Cal_Month={'$(vMax_Month)'}, Cal_Quarter=, Cal_Date={"<=$(=Max({$<Cal_Year={'$(vMax_Year)'}>}Cal_Date))"} >}Distinct [Employee Code])/
((
Count({$<Cal_Month_Flag={1}, Cal_Year={'$(vMax_Year)'}, Cal_Month={'$(vMax_Month)'}, Cal_Quarter=, [Active Flag DayWise]={1}>}DISTINCT [Employee Code])+$(vTest))/2))/
Count({$<Cal_Year={'$(vMax_Year)'}, Cal_Month={'$(vMax_Month)'}, Cal_Quarter=, [Cal_Month ID]={"<=$(=Max([Cal_Month ID]))"}>}DISTINCT [Cal_Month ID]))*12),Cal_Month)),'#0.00%')