Skip to main content
Announcements
Live today at 11 AM ET. Get your questions about Qlik Connect answered, or just listen in. SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

conditional hide straight table and list boxes

Hi, I wanted to set a conditional expression to only show straight tables and list boxes let's say if the current selections are for current quarter and weeks range from week 1 thru week 4 of the quarter. ( I have a flag that counts the weeks in the quarter). Also, I am using this on a different state (Alternate states) within the dashboard. Any help is greatly appreciated.

1 Solution

Accepted Solutions
JonnyPoole
Employee
Employee

Hi - i altered the conditional show hide expression to this:

only(  {B} Curr_Qtr_Flag) = 'Y'  and concat( {B} distinct Wk_in_FQ ,';') = '1;2;3;4'

only(  {B} Curr_Qtr_Flag) = 'Y'  --->  means that the only possible value for Curr_Qtr_Flg in the current selections for the Alternate State 'B' is 'Y' .  Looing at the screenshot below , the Curr_Qtr_Flag list box shows Y as the only value that is green or white so this is TRUE

concat( {B} distinct Wk_in_FQ ,';') = '1;2;3;4'  --> Means that the only possible values for Wk_in_FQ in the current selections for the alternate state 'B' is  1,2,3 and 4.  The concat() function lists all the possible values with a delimitter. In my case the delimitter is ';'.  If i add a distinct it will only list one instance of the value. So below i have selected only 1,2,3, and 4 (green or white) and that means this will evaluate to 1;2;3;4  or TRUE

Capture.PNG.png

View solution in original post

14 Replies
JonnyPoole
Employee
Employee

Here is a sample expression that would check to see if a Quarter(s)  and Week(s) were selected and then figure out if the Quarter selected is the current quarter (based on a variable) and the flag for #weeks selected = 4.  Your specifics will change a bit but a QVW sample will help give more detailed solutions:

if(  getselectedcount(Quarter) > 0 and getselectedcount(week) > 0 and  only(Quarter) = $(vCurrentQuarter)  and $(vWeekCountFlag) = 4 )

Also, you will need SET ANALYSIS to pull these selections from an Alternate State. The good news is that you can now (just in last few days) download qlikview 11.2 SR8 and leverage alternate states in the getselectedcount() function per the SR8 release note below:

1.3.2 Alternate state parameter for certain functions

New parameter added to the functions “GetSelectedCount()”, “GetFieldSelections()” and

“GetCurrentSelections()” to query other states than the main state.

E.g. =GetFieldSelections(Quantity, ';', ,'StateA')

Anonymous
Not applicable
Author

Great! So I just need to download the latest Qlikview and i should be able to apply those field functions?

Thanks!

JonnyPoole
Employee
Employee

Those field functions are in the product now and have been for years, but when Alternate States was introduced 2 years ago, these could not pull the values from the alternate states, only the default state.  Now in SR8 they can pull from alternate states... so handy for use case.

Anonymous
Not applicable
Author

Thanks, am downloading it now. Will let you know when I get it to work.

Thanks again.

Anonymous
Not applicable
Author

Hi, I have downloaded the new SR8 version of qlikview. I added these expressions in "show - conditional" in the layout tab.

if(  getselectedcount(Curr_Qtr_Flag) > 0 and getselectedcount(Wk_in_FQ) > 0 and  only(Curr_Qtr_Flag) = 'Y'  and (Wk_in_FQ) <=4

when i tested this with other quarter, the table is still there....do i need to set up variables? The curr_qtr_flag and wk_in_FQ are both in the back end calendar table that's linked to the main table.

Thanks!

JonnyPoole
Employee
Employee

Do any of these conditions in the IF need to be evaluated off  the selections in an alternate state ? 

This would be the syntax if needed.  This would check if the user has made a selection on the field called  [Field] in the alternate state called 'AlternateStateName'.

getselectedcount( [Field],1,'AlternateStateName')

Anonymous
Not applicable
Author

if(  getselectedcount([Curr_Qtr_Flag],1,'AlternateStateB') > 0 and getselectedcount([Wk_in_FQ],1,'AlternateStateB') > 0 and  only(Curr_Qtr_Flag) = 'Y'  and (Wk_in_FQ) <=4

does that look right? I have 3 states in the dashboard - inherited, A, and B. I made the above changes but still not working...

Thanks!

JonnyPoole
Employee
Employee

the last condition looks a little strange ( (Wk_in_FQ) <=4)  , can you share a QVW example ?

Anonymous
Not applicable
Author

Hi, the list boxes at the top of the page is based on State A, and the ones at the bottom of the page are State B. I am trying to apply the conditional hide/show for all the table and list boxes in state B.

Thanks again!