Qlik Community

Ask a Question

QlikView App Dev

Discussion Board for collaboration related to QlikView App Development.

Announcements
Join this live chat April 6, 10AM EST - QlikView to Qlik Sense REGISTER
cancel
Showing results for 
Search instead for 
Did you mean: 
manpri7078
Creator
Creator

Dynamic Input Box dependent on another list box selection

Hi All,

I am attaching herewith sample document as well as sample excel file for my query.

In my document one list box is for SOB. And I am making input box which will contain only possible values from selected SOB which have values more than 0 or less than 0 and are not blank.

For example, if I select field 5 from the list box, my input box should contain only those five heads which have values more than 0 or less than 0 as can be seen from the table therein.

Please guide me how to do it as my input box is showing all the values.

Regards

Manish Prasad

1 Solution

Accepted Solutions
kusumanchir
Creator
Creator

Hi Manish,

Please try this way,

Create another variable to get the dynamic selection from SOB,

variable : vDynField

=getfieldselections(SOB) )


Expression:

=Concat({<SOB={"$(vDynField)"},'$(vDynField)'={">0<0"}>}Description, ',').

Regards,

Rasly.K

View solution in original post

12 Replies
devarasu07
Master II
Master II

Hi,

Try like below

=IF(GetFieldSelections(SOB)='Field 5',Concat({1} DISTINCT {<SOB={'Field 5'},[Field 5]={'>0'}>}Description, ',', Description))

Capture.JPG

manpri7078
Creator
Creator
Author

Hi,

It is not giving me correct results even for Field 5 for selected month and selected year.

only showing three drop down values. One mistake was there in my query which I have edited now and that is value may be more than 0 or less than 0. So in Field 5 for selected month of Jun and selected year of 2018 there are five heads which fulfills this condition so my input box should be showing all these 5.

Another thing is that I would not like to hard code Field 5 there. It will pick the selection from the list box at the top.

I hope I have clarified my query more here.

Regards

Manish Prasad

kusumanchir
Creator
Creator

Hi Manish,

Please try this way,

Create another variable to get the dynamic selection from SOB,

variable : vDynField

=getfieldselections(SOB) )


Expression:

=Concat({<SOB={"$(vDynField)"},'$(vDynField)'={">0<0"}>}Description, ',').

Regards,

Rasly.K

View solution in original post

manpri7078
Creator
Creator
Author

Hi,

I have myself try to get a solution and almost done with some unexpected error. Every time I change the selection in the SOB List Box, I have to right click my input box and then click apply to reflect changes.

Otherwise my expression is calculating perfectly. I am attaching my modified app.

Can you guide me what changes is to be done now.

Regards

Manish Prasad

mangalsk
Creator III
Creator III

PFA it is working as required, kindly check

manpri7078
Creator
Creator
Author

Hi Mangal,

It is still not working. When exploring through your input box, the expression as defined in the constraints tab is showing red lines.

And also when I am making selection changes in my SOB List Box, the input box is not getting populated accordingly as desired.

Please see also my own post just before your post where I have myself tried to come out the solution. My expression is working perfectly but every time I am making changes in the list box selection, I have to right click my input box and then I have to click on Apply button to reflect changes.

That behavior is what I need to avoid. Please guide me accordingly

Regards

Manish Prasad

mangalsk
Creator III
Creator III

We don't need to bother about red lines , since we used variable it is showing but it is correct for cross checking you can see result in straight table using same expression and description as dimension

There is some setting may be i am not sure but just another suggestion you can use list box and you can set then according to how you want to display, use following expression in list box

=if(Len([$(v_sob)])>=1,Description)

manpri7078
Creator
Creator
Author

Hi Mangal,

Your suggestion may be helpful to me, except one loophole. I would not like to see the head whose amount is 0 or blank in the newly created list box. But as per your expression, that also is showing.

Any modification needed in your expression :  =if(Len([$(v_sob)])>=1,Description) ?

Please guide me

Regards,

Manish Prasad

mangalsk
Creator III
Creator III

The given expression works for blank also because blank means length=0 so len>=1 means it has some value on top of that if you also want to exclude where value=0 then use =if(Len([$(v_sob)])>=1 or [$(v_sob)]=0,Description)