Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Want to see what's currently in public preview? We've pulled it all together in one place. Check it out here
cancel
Showing results for 
Search instead for 
Did you mean: 
deepakqlikview_123
Specialist
Specialist

Condition not working

Hi all ,

My condition for set analysis for previous year is not working can you please suggest on this.

Below is the condition,

if((Sum({<Head = {'Bcone'},FlagNum = {"$(vAttriationFlagNum)"},Year={'$(=(max(Year)-1))'},Month_Num={'<=$(=max(Month_Num))'}>}Attrition))

=0,

((Sum({<Head = {'Bcone'},FlagNum = {"$(vAttriationFlagNum)"},Year={'$(=(max(Year)-2))'},Month_Num={'<=$(=max(Month_Num))'}>}Attrition))),

((Sum({<Head = {'Bcone'},FlagNum = {"$(vAttriationFlagNum)"},Year={'$(=(max(Year)-1))'},Month_Num={'<=$(=max(Month_Num))'}>}Attrition)))))

Labels (1)
6 Replies
vinieme12
Champion III
Champion III

if((Sum({<Head = {'Bcone'},FlagNum = {"=$(vAttriationFlagNum)"},Year={'$(=(max(Year)-1))'},

Month_Num={"<=$(=max(Month_Num))"}>}Attrition))

Vineeth Pujari
If a post helps to resolve your issue, please accept it as a Solution.
vinieme12
Champion III
Champion III

i think you can also try Year without ' quotes Year={$(=(max(Year)-1))}

Vineeth Pujari
If a post helps to resolve your issue, please accept it as a Solution.
deepakqlikview_123
Specialist
Specialist
Author

Hi Vineeth,

Month_num is still  not working

thanks

vinieme12
Champion III
Champion III

Strange, does max(Month_Num) evaluate correctly in a text box? ARE both Numeric fields?

try below :

if(Sum({<Head = {'Bcone'},FlagNum = {"=$(vAttriationFlagNum)"},Year={$(=(max(Year)-1))}

,Month_Num={"<=$(=max(Month_Num))"}>}Attrition)=0,  //Then

Sum({<Head = {'Bcone'},FlagNum = {"=$(vAttriationFlagNum)"},Year={'$(=(max(Year)-2))'}

,Month_Num={"<=$(=max(Month_Num))"}>}Attrition),    //Else

Sum({<Head = {'Bcone'},FlagNum = {"=$(vAttriationFlagNum)"},Year={'$(=(max(Year)-1))'},

Month_Num={"<=$(=max(Month_Num))"}>}Attrition)

)

Vineeth Pujari
If a post helps to resolve your issue, please accept it as a Solution.
deepakqlikview_123
Specialist
Specialist
Author

Hi All,

Year={'$(=(max(Year)-1))'} is not working in set analysis here



Thanks

vishsaggi
Champion III
Champion III

Try this:

Year = { $(= max(Year)-1)) }