Qlik Community

QlikView App Dev

Discussion Board for collaboration related to QlikView App Development.

cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Nested If statement not working

I need to display a stacked bar chart with  2015, 2016 , 2016-Q3, 2016-Q4 and 2016 - Jul  as X axis, whereas Jul is in the third quarter as per the calendar.

=if(FY_12='2015',FY_12,(if (FY_12='2016' and Quarter_12='3',FY_12&'-Q'&Quarter_12,(if (FY_12='2016' and Quarter_12='4',FY_12&'-Q'&Quarter_12,(if(FY_12='2016' and Month_12='Jul',

FY_12 & '-'& Month_12,(if (FY_12='2016',FY_12,)) ))

)))  ))

As per the above if condition, the charts are not displaying values for 2016-Jul. Could someone help me in tweaking this if condition?

12 Replies
Anil_Babu_Samineni

Does Jul You have taken Manually.

=if(FY_12='2015',FY_12,if(FY_12='2016' and Quarter_12='3',FY_12&'-Q'&Quarter_12,if (FY_12='2016' and Quarter_12='4',FY_12&'-Q'&Quarter_12,if(FY_12='2016' and Month_12='Jul', FY_12 & '-'& Month_12,if (FY_12='2016',FY_12)))))

Before develop something, think If placed (The Right information | To the right people | At the Right time | In the Right place | With the Right context)
Not applicable
Author

Yes, I have passed as Jul manually , at this point.

Anil_Babu_Samineni

Some Performance, It might helps

=if(WildMatch(FY_12='2015',FY_12), if(Pick(FY_12='2016' and Quarter_12='3',Match(FY_12, Quarter_12)),

if (Pick(FY_12='2016' and Quarter_12='4',Match(FY_12,Quarter_12)), if(Pick(FY_12='2016' and Month_12='Jul', Match(FY_12, Month_12), if (WildMatch(FY_12='2016',FY_12))))))

Before develop something, think If placed (The Right information | To the right people | At the Right time | In the Right place | With the Right context)
Not applicable
Author

Hmm, thanks for the suggestions , but not working Anil.

Anil_Babu_Samineni

Why it not working? Is there any screen shot. can you provide i/p Why it's not working

Before develop something, think If placed (The Right information | To the right people | At the Right time | In the Right place | With the Right context)
avinashelite

could you be able to share the sample app ??

sushil353
Master II
Master II

Try this out

=if(FY_12='2015',FY_12,

        if (FY_12='2016' and Quarter_12='3',FY_12&'-Q'&Quarter_12,

               if (FY_12='2016' and Quarter_12='4',FY_12&'-Q'&Quarter_12,

                         if(FY_12='2016' and Month_12='Jul',FY_12 & '-'& Month_12,

                                   if (FY_12='2016',FY_12)

                           )

                    )

               )

     )

shraddha_g
Partner
Partner

Try

if( wildmatch(FY_12,'2015') , FY_12,

       if(wildmatch(FY_12,'2016')  and wildmatch( Quarter_12,'3'), FY_12&'-Q'&Quarter_12,

               if(wildmatch(FY_12,'2016')  and wildmatch( Quarter_12,'4'),FY_12&'-Q'&Quarter_12,

                        if(wildmatch(FY_12,'2016')  and wildmatch( Month_12,'Jul') ,FY_12 & '-'& Month_12,

                                  if( wildmatch(FY_12,'2015') , FY_12 )))))

I hope it is helpful.

Not applicable
Author

Hey Guys,

Thanks so much for all your solutions. It seemed like since there is only one month (Jul) in the respective quarter (in this scenario Q4) and when I provide conditions for both Q4 and Jul month it is producing data in a single bar instead of multiple. Now that I have added one more month in the data (Ex : Aug) to the Q4, all the above mentioned conditions produce two bars , one for Q4 and another for Jul, which is eventually right.s

Regards,

Arun