Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
raadwiptec
Creator II
Creator II

exclude

I want to exclude an  invoice number from the list box as default. but would like to use it when required .. is there a good way?

1 Solution

Accepted Solutions
Jason_Michaelides
Luminary Alumni
Luminary Alumni

In the script:

LOAD

  <your other fields>...,

  If(InvoiceNumber=xxx,1,0) AS %Flag_HideInvoice

FROM....;

In the app, create a button or text box with a Select In Field action. Choose the %Flag_HideInvoice as the field, and as the value put:

If(only(%Flag_HideInvoice)=0,'',0)

This will then toggle between all invoices and the non-hidden ones only. 


Hope this helps,


Jason


View solution in original post

26 Replies
Chanty4u
MVP
MVP

did you tried select excluded  option in properties?

or may be

  =aggr(Only({1-$} FieldName),FieldName).

Peter_Cammaert
Partner - Champion III
Partner - Champion III

If this will always be the same Invoice Number, you can create a button that sets/resets an include/exclude variable, and create a listbox that either shows all field values or only those that are different from that specific Invoice Number.

While this may be an answer to your question, it won't do much in the remaining part of your document. That Invoice number will still show up in charts and tables. Can you elaborate on why you need this behavior?

Peter

raadwiptec
Creator II
Creator II
Author

hi chanty,

where should this be added?

hi peter.

Yes it is only one invoice number.. i cannot give a you  a sample app as it is abig file.. can u give me more details?

Jason_Michaelides
Luminary Alumni
Luminary Alumni

Do you only want to hide it from the list box or do you want it excluded from all calculations too? I.e. Should Sum(Sales) include or exclude this invoice? If you only want to hide it then you need to use an expression in the list box like the example above, or If(InvoiceNumber<>'xxx',InvoiceNumber). 

If you want this invoice excluded from all calcs by default is create a flag field on all invoice numbers where this one is 0 and all others are 1. You can then select/lock/hide this flag field as required. 


Hope this helps,


Jason

Anil_Babu_Samineni

Have you tried this on listbox expression

=If([invoice number],If([invoice number]<> '127448363',[invoice number]))

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
tresesco
MVP
MVP

May be like in the attached qvw.

raadwiptec
Creator II
Creator II
Author

hi jason,

yes i like to have as u mentioned.. I want to hide it as default and should be excluded from all calculations ..and for some users i would like to give an option so once they select the invoice gets included and for all calculations also it should be taken into account

can you let me know how to achieve this

Jason_Michaelides
Luminary Alumni
Luminary Alumni

In the script:

LOAD

  <your other fields>...,

  If(InvoiceNumber=xxx,1,0) AS %Flag_HideInvoice

FROM....;

In the app, create a button or text box with a Select In Field action. Choose the %Flag_HideInvoice as the field, and as the value put:

If(only(%Flag_HideInvoice)=0,'',0)

This will then toggle between all invoices and the non-hidden ones only. 


Hope this helps,


Jason


Anonymous
Not applicable

Did you try this?

Simply add a expression to your LB instead of field name like this?

If(InvoiceNumber<>'123', InvoiceNumber)