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

Announcements
Join us in Toronto Sept 9th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
helen_pip
Creator III
Creator III

Streamline Nested If into Pick(Match

Dear Qlikview user

I am having problems trying to streamline an If statement and use a Pick(Match instead:

My Original expression is:

if(($(v_Flow_Graph_Arrival_Colour_Show)),

if(Flow_Stage='Before Stream',

  if(ED_Mode='Amb',

   $(e_Flow_Graph_Arrival_Colour_Amb),

   if(ED_Mode='Car', 

    $(e_Flow_Graph_Arrival_Colour_Car),

      if(ED_Mode='Heli',

       $(e_Flow_Graph_Arrival_Colour_Heli),

     if(ED_Mode='Other', 

      $(e_Flow_Graph_Arrival_Colour_Other),

      $(e_Flow_Graph_Line_Colours)

  ))))

v_Flow_Graph_Arrival_Colour_Show = 1 then the relevant colours will show else $(e_ED_Summary_Flow_Graph_Line_Colours)


I have attempted a Pick match but it is not exactly working


=Pick(Match($(v_Flow_Graph_Arrival_Colour_Show) &'-'& Flow_Stage &'-'& ED_Mode, '1-Before Stream-Amb', '1-Before Stream-Car', '1-Before Stream-Heli', '1-Before Stream-Other')+1,

$(e_Flow_Graph_Arrival_Colour_Amb),

$(e_Flow_Graph_Arrival_Colour_Car),

$(e_Flow_Graph_Arrival_Colour_Heli),

$(e_EFlow_Graph_Arrival_Colour_Other),

$(e_Flow_Graph_Line_Colours)

)


Can anyone help me try and achieve the nested pick match


Kind Regards

Helen




1 Solution

Accepted Solutions
sunny_talwar

May be this

=Pick(Match($(v_Flow_Graph_Arrival_Colour_Show) &'-'& Flow_Stage &'-'& ED_Mode,


'1-Before Stream-Amb',

'1-Before Stream-Car',

'1-Before Stream-Heli',

'1-Before Stream-Other') + 1,

$(e_Flow_Graph_Line_Colours),

$(e_Flow_Graph_Arrival_Colour_Amb),

$(e_Flow_Graph_Arrival_Colour_Car),

$(e_Flow_Graph_Arrival_Colour_Heli),

$(e_EFlow_Graph_Arrival_Colour_Other))

View solution in original post

3 Replies
Anil_Babu_Samineni

Is this showing any error to you for validation? And meanwhile, please try to define the variables?

Try this?

=Pick(Match(($(v_Flow_Graph_Arrival_Colour_Show) &'-'& Flow_Stage &'-'& ED_Mode), '1-Before Stream-Amb', '1-Before Stream-Car', '1-Before Stream-Heli', '1-Before Stream-Other')+1,

$(e_Flow_Graph_Arrival_Colour_Amb),

$(e_Flow_Graph_Arrival_Colour_Car),

$(e_Flow_Graph_Arrival_Colour_Heli),

$(e_EFlow_Graph_Arrival_Colour_Other),

$(e_Flow_Graph_Line_Colours)

)

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
sunny_talwar

May be this

=Pick(Match($(v_Flow_Graph_Arrival_Colour_Show) &'-'& Flow_Stage &'-'& ED_Mode,


'1-Before Stream-Amb',

'1-Before Stream-Car',

'1-Before Stream-Heli',

'1-Before Stream-Other') + 1,

$(e_Flow_Graph_Line_Colours),

$(e_Flow_Graph_Arrival_Colour_Amb),

$(e_Flow_Graph_Arrival_Colour_Car),

$(e_Flow_Graph_Arrival_Colour_Heli),

$(e_EFlow_Graph_Arrival_Colour_Other))

helen_pip
Creator III
Creator III
Author

Thanks Sunny

This has helped me on my way!

Thanks

Helen