Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
andymanu
Creator II
Creator II

Filter Data using Flags

Hi,

I got an issue with regard to the use of flags to filter the data.

Assume I got a table as mentioned below,

   

Prod_IDProd_NameDateQuantitySelling PriceCountry1
P100A10/02/20182010NZ
P101B15/03/20181515AUS
P102C14/01/2018285UK
P103D20/03/20183010AUS
P103D10/01/20181415NZ
P104E25/02/20182820DEN
P102C10/04/20183010NZ

I am using a flag (named Flag1) to filter the data where the Country is "NZ' ,the quantity is greater than 15 and the Selling Price > 15.

Thus the result should be something like below,

   

Prod_IDProd_NameDateQuantitySelling PriceCountry1
P100A10/02/20182010NZ
P102C10/04/20183010NZ

The sample statement to set the flag would be,

"If(Country = 'NZ' and Quantity >15 and "Selling Price" >10,1,0) as Flag1"

Once I have loaded the data to Qlik Sense, I need to visualize the data (May be in a Table format) after application of the filter.

Without applying the filter (may be as an expression), it will display the entire 7 data records.

Could anyone please explain me how to accomplish the above task cos I am posting this discussion for the second time.

Note

Kindly explain where I need to apply the expressions to filter the data and visualize only the output results in Qlik Sense after the "Data Load" process.

Awaiting for you valuable reply.

Regards

Andy

7 Replies
YoussefBelloum
Champion
Champion

Hi,

if you're creating the Filter Flag 1, just use the Value 1 in a listbox for example and all the table will be filtered as expected.

what is the issue here ?

andymanu
Creator II
Creator II
Author

Hi Youssef,

I could use the below code to load the original data in to qlik sense,

Table:

LOAD

    Prod_ID,

    Prod_Name,

    Date,

    Quantity,

    Selling Price,

    Country1,

    If(Country = 'NZ' and Quantity >15 and "Selling Price" >10,1,0) as Flag1

FROM (XXXX)

Assume I load the data in to qlik sense and go to "App Overview" to create a table and visualize the data, it will show the entire data set as below,

Requirement?

I want to visualize the data which fulfills the requirement of the Flag.

Note

I have heard that there is an option to create an expression for fields so that it will only presents the filtered data. ( According to the scenario it should be something like,

I know it is bit tricky to explain, but actually may be a simple thing I am missing here.

Hope you understood the issue now.

Look forward to hearing from you.

Regards,

Andy

andymanu
Creator II
Creator II
Author

Hi

Actually the final output shuld be something like below,

I will not have the field name "Flag" thus, cannot use the select option from the "Flag" field.

Hope it is clear for you.

Regards,

Andy

rangam_s
Creator II
Creator II

Try this.

Add a measure like below (instead of country dimension) so that you will see only records with matching criteria

=only({<flag={1}>}Country1)

However, there are no records matching with your condition.

chinnuchinni
Creator III
Creator III

hi,

try to take total data with using resident load from table and give the condition as where flag =1

andymanu
Creator II
Creator II
Author

Hi Rangam,

Thanks for your reply.

I can add other fields as necessary as a measure fulfilling a flag requirement right? Assuming I got more than a single flag.

Thanks,

Regards,

Andy

andymanu
Creator II
Creator II
Author

Hi Praveen,

Yes I could use the WHERE clause. But the issue is it removes the data which does not fulfill the WHERE condition.

My requirement was to view the resulted data while not loosing the not matching data rows.

Thanks.

Regards,

Andy