Skip to main content
Woohoo! Qlik Community has won “Best in Class Community” in the 2024 Khoros Kudos awards!
Announcements
Nov. 20th, Qlik Insider - Lakehouses: Driving the Future of Data & AI - PICK A SESSION
cancel
Showing results for 
Search instead for 
Did you mean: 
dmohanty
Partner - Specialist
Partner - Specialist

Select & Delete/Hide a value from List Box on Action of a Button - Help!!

Hi All,

I am loading some data into QVW from a QVD and displayed in a list box. Let the data looks like this -

UserRegion
AA1
AA2
AA3
AA4
BB1
BB2
BB3
CC1
CC2
CC3
CC4
C

C5

Suppose the User A logs-in and sees his data as A1, A2, A3, A4.

Requirement:

Now he wants to select some, let say A1 and A4 and want to Delete/Hide it from the List Box (remember, not required to delete from QVD), using the help of a Button.

Whenever he has to click on a Button, the selected values should go hidden and should not be loaded from QVD from next time on-wards too.

We might need any variable to be passed here - the selected values should be assigned a value in the variable and that value has to be taken care from next reload of qvd.

Could anyone help here please?

Message was edited by: Dicky Mohanty

17 Replies
marcus_sommer

If the user could store and reload the application then you need to build from those selections a variable which would be used as where-clause within the load-statement, something in this way:

vWhere: not match(Region, $(=getfieldselections(Region, ', ')))

If the user couldn't store (working per access point) you will need some strategy to store those selections externally, maybe per macro in a text-file or per https://community.qlik.com/search.jspa?q=write+back&type=document.

- Marcus

sudeepkm
Specialist III
Specialist III

May be section access. The section access logic table can contain the field values that user does not want to see on the Dashboard. At the time of reload it can be taken care. Any time they want their data back they just need to modify the records in Section Access logic table and reload the document.

Managing the values what they want to see or not will be in the Section Access logic table that could be available in a DB table or spreadsheet.

dmohanty
Partner - Specialist
Partner - Specialist
Author

Hi Marcus,

I agree with your second point -  If the user couldn't store (working per access point)

The user has just to access the report from Access Point >> Select few values from List Box >> Click on a Button to delete or hide and he won't see further. Even though the value is available in the QVD, these won't be reloaded into the document next reload on-wards.

Any help here?

dmohanty
Partner - Specialist
Partner - Specialist
Author

Hi Sudeep,

This suggestion will be difficult to maintain I guess. There are not 1 or 2 or 10 values - There might be 100 of values from the List Box , that the user want to remove. Maintaining those in Section Access will be difficult.

Also, they don't have access to Section Access script to modify.

marcus_sommer

For me it's not quite clear what is aimed with those deleting/hiding but I think it should be at first to solve this with rather practically approaches before starting a complex developing-task, maybe in this way:

- listboxes and dimensions in object are calculations which only showed values which aren't in a variable like vDataReducing which will be filled with the getselection values from those fields and which is be triggered from this button - this alone could be already enough

- in another chart is the opposite from them and this will be per the same button exported into a network-store which the load-routines from this application read in a loop each time and created from them a distinct filter for a where-clause

- Marcus

dmohanty
Partner - Specialist
Partner - Specialist
Author

Hi Marcus_Sommer

The reason for User being removing the values is - there are some values which are gone Obsolete and User only wants to remove them or hide them. Developer don't have rights to remove them from QVD.

From the list box itself, user will decide, which values he has to remove.

So wanted a similar solution like - whatever the values he selects and clicks button, those will be assigned with a Variable Value and will be remembered whenever next time it is reloaded.

sudeepkm
Specialist III
Specialist III

Understood. One quick question what about multi user interaction. If one user marked a value to be removed from the data set and at the other hand the other user needs it.

I think your requirement is to have a solution on the UI to hide those selected values immediately and then not to consider those values while reloading data next time.

As Marcus suggested you need to explore more on the Write back capability. This is how I would recommend designing the solution.

1. Create a new field like a flag at your data source such as "Val_Ignore"

2. Use where clause to ignore records where Val_Ignore = 'YES' (better to use number such as 0 or 1)

3. Use write back solution on the UI (one example is here Free Text Box Extension Object) using which users can select the particular value that they do not want to get reloaded next time. using this write back users will set Ignore to the record.

4. Now the question is how soon that change should get reflected in the UI which depends upon the data refresh. You may consider using Partial reload for this table which will support higher frequency load without causing to run the script for other tables in the same qvw script.

Not applicable

You can create an object (button ou text box) and add an action "select excluded" for the field (Region).

dmohanty
Partner - Specialist
Partner - Specialist
Author

Hi sudeepkm,

You understood the requirement correctly. To handle the Multi User problem, we have Section Access and any user can remove any values that belongs only to him (may be corresponding ID/Key has to be removed). So there is no issue if any value is hidden immediately and then not to consider those values while reloading data next time.

Could you show me with a sample app please what you have explained?

I actually tried in two steps in a Button -

  1. Select Excluded field
  2. Then apply a Macro (Which is not working in AJAX mode)

SUB AfterReload

  ActiveDocument.ReduceData

END SUB

Regarding the refresh of the data/QVW - it happens daily once. If the User selects are hides the values from the List box (and it has to be stored in Variable or any Flag field), then the next day the QVW has to be reloaded using Where clause, not to bring that value into the field.