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: 
Not applicable

Selection

Hi everybody,

i would like to know how to select only some row from a table using a formula.

Thai is, i know that i want to select and export only the rows according to a formula...  To select i use a button but I don't know how to set the formula...

I want only the rows where field A is equal to "PIPPO" and field B is null...  Is there a way to use a formula to decide which rows i want to see in a table (it's a sort of selection formula).

I hope the explanation is clear enough.

Thanx in advance

R.

4 Replies
Not applicable
Author

Hi,

would you like to show only the records with Field A = Pippo and Field B = ''  OR you want to have your table with all the rows and just when you push a button reduce the number of rows in according to your rules?

regards

Gysbert_Wassenaar

You can't select nulls so a Select in Field action for field B won't work. But perhaps you can use a calculated dimension to achieve what you want. Mabye something like: if([field A] = 'PIPPO' and len(trim([field B]))=0, [field A]). And enable the option Suppress When Value Is Null for the calculated dimension.

Of course, a good practice is to replace nulls during the load with some value that can be selected. You can use the NullAsValue statement and NullValue variable. The two lines below would replace all nulls with the string 'Null' if you place them at the start of the script.

Set NullValue = 'Null';

NullAsValue * ;


talk is cheap, supply exceeds demand
Not applicable
Author

The second one is right.... Using a button I want to reduce the number of rows...

I think that using a formula is the better way to do that.. because with simple action I cannot tell to select a field when it's null...

Not applicable
Author

I think Gysbert way it's perfect for you.

If you want to use a button you have only add a test of a variable.

For instance.

Pushing on ButtonA you can set a variable vHide = 1.

Then you test the var.

if ($(vHide) = 1,

     if([field A] = 'PIPPO' and len(trim([field B]))=0, [field A])

,

     [field A]

)

Use ButtonB to set your variable to 0.

Hope it helps

regards