Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
bhavvibudagam
Creator II
Creator II

Current Month vs Last Month Expression

Hi Experts,

Can any one please help me on this.

I have current and Previous expressions.

By default the KPI is showing Nov 2017=27 for Current Period and Oct 2017=34 for Previous period

But again when i have selected Nov 2017 its changing to 29 for Oct-2017 from 34

I have used the below expressions

Current Month:


=Sum(if(Aggr(Max({$<MonthYear={'$(=$(vG.CurrentPeriod))'},[Metric Group]-={"'-'"},[Metric]-={"'-'"},Group-={"''-"},[sub Group]-={"'-'"}>}[RAG ind])Metric)=2,1,0))


Lat Month:


=Sum(if(Aggr(Max({$<MonthYear={'$(=$(vG.PreviousPeriod))'},[Metric Group]-={"'-'"},[Metric]-={"'-'"},Group-={"''-"},[sub Group]-={"'-'"}>}[RAG ind])Metric)=2,1,0))



Please help me on this. Here the variables and logic is working fine.

By default and when I have selected Oct 2017 then its showing 34 only for October.

But while selecting Nov 2017 only 34 is changed to 29.

Issue before.png

Issue.png

Thanks in advance

4 Replies
Anil_Babu_Samineni

To make constant use {1} for analysis expression.

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
bhavvibudagam
Creator II
Creator II
Author

Hi Anil,

Actually As per the Requirement User need to select the months. Its strange behavior

The selections are like below.Is there any other changes need to make in the above expressions.

Month                                          Current Period                  Previous Period

By default with out selection        27  (November)                      34(October)

selecting November                      27  (November)                      29(October)

Selecting October                        34  (October)                          26(September)


also when i have added {1} in the Current expression then 27 changed to 20

=Sum(if(Aggr(Max({$<MonthYear={'$(=$(vG.CurrentPeriod))'},[Metric Group]-={"'-'"},[Metric]-={"'-'"},Group-={"''-"},[sub Group]-={"'-'"}>}{1}[RAG ind])Metric)=2,1,0))


Thanks,

Anil_Babu_Samineni

Better if you provide sample application? Because, When value is not matched to each that means there is some other filter associate to that so that is the thought please forcibly {1} to your statement. But, I don't want to force now. To modify ur expression my intend is below

=Sum(if(Aggr(Max({1<MonthYear={'$(=$(vG.CurrentPeriod))'},[Metric Group]-={"'-'"},[Metric]-={"'-'"},Group-={"''-"},[sub Group]-={"'-'"}>}[RAG ind])Metric)=2,1,0))

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
bhavvibudagam
Creator II
Creator II
Author

Hi Anil,

Thanks for your reply.

Could you please clarify my doubt. By passing 1 into set analysis other months selections will be afftected or not.

Please confirm.