Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

How to allow the user to select filter options

Hello,

I am new to Qlikview so maybe this is easy to do and I just cannot find the way to handle it.

My situation is that I have a large number of sales records. One of the aggregate values I need to show is an average of the rate paid for like units. This is not a problem. The problem comes in because there are a large number of valid records where the price is zero.

What I cannot find out how to do is to give the user the option to exclude from all result sets and calculations everywhere any sales record with a zero unit cost.  There are times when these records belong in the view and others when it does not. I want to give the user the option to include zero dollar units or to exclude them and i cannot find out how.

There is a demo which looks like it might do something like this (SnowView) but I am using the evaluation version and for some reason that one demo app requires a licensed copy to open it.  Along the same lines if anyone has a answer, please explain it. I will not be able to open any samples you send me until i can prove this product does what we need and I get the licensed version.

TIA,

Matthew Fleck

3 Replies
jaime_aguilar
Partner - Contributor III
Partner - Contributor III

You can achieve that by creating a calculated field in script,

Let's suppose you have an Excel file with 2 columns: Products and Price. Some products have a price > 0, others have exactly zero. Then with and If you create a field so you can select zero values and non-zero values.

So if you try to run the following script you'll have a field that will allow you to filter the products you want. Besides as a note, on charts you have to disable in the presentation tab, the option called suppress zero-values so you can see zero values if you use sum(Price) as an expression on any table/chart

Prices:

LOAD Product,

     Price,

     if(Price = 0, 'Zero Prices', 'Non-Zero Prices') as Filter

FROM

(ooxml, embedded labels, table is Sheet1);

regards,

Jaime

Not applicable
Author

Hi Jaime,

This will work but it is just one of the filtering methods I was hoping to I was hoping to be able to provide with QV and I do not want to have to add every one of these to every result set.  One main reason for this is there are standard data extracts which my clients can export from the system and I want them to be able to load them into the views unaltered.

Is there another way that you know of to define options which will apply filters?

Gysbert_Wassenaar

You can probably use bookmarks.

Add the price field temporarily as a listbox. Clear all selections and then select 0 in the listbox. Add a new bookmark and name it Zero Prices. Make sure to check the option Make Bookmark apply on top of current selection. Next, right click the price listbox and choose Select Excluded. Now add another bookmark and name it Non-zero Prices. Again check the option Make Bookmark apply on top of current selection. Finally remove the listbox. Your users can now use the bookmarks to choose between zero and non-zero prices.


You can add more bookmarks for selections in other fields if you want to apply them independently of each other.


talk is cheap, supply exceeds demand