Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Join us in NYC Sept 4th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

excluding records in the script

Hello All,

I have a product_id for which want to only include data till 2015,

but for 2016 i dont want to include that in the script.

for example only include data for product_id 126 till 2015 not in 2016.

How can i do this in the script?

Please help.


Thanks & Regards,

Jaya

12 Replies
sunny_talwar

May be like this:

LOAD *

FROM Source

Where not (Product_id = 126 and Year = 2016);

MayilVahanan

Hi

Try like this

Load * from yourtablename where Year < 2016 and product_id  = 126;

Thanks & Regards, Mayil Vahanan R
Please close the thread by marking correct answer & give likes if you like the post.
Not applicable
Author

Thanks Sunny for the reply.

the year feild is in the calender table which is being loaded late based on a order_date.

in the source table there is the product_id and order_id.

How do i do this?

MayilVahanan

Hi

Then try like this

Load * from yourtablename where Year(order_date) < 2016 and product_id  = 126;

Thanks & Regards, Mayil Vahanan R
Please close the thread by marking correct answer & give likes if you like the post.
Not applicable
Author

Thanks Mayil.

Can i also do it in the straight table?

sunny_talwar

Or this:

LOAD *

FROM Source

Where not (Product_id = 126 and Year(order_date) = 2016);

Not applicable
Author

Thanks sunny for your help as always.

But can we also put this condition on in the expression in the straight table??

Not applicable
Author

Hello Sunny,

Can i use the below expression.?

how do i include Year=2016 in the below expression?

aggr(if(match(product_id,'126')=0, product_id),product_id)

Appreciate your help.

Regards,

Jaya

sunny_talwar

You can. May be like this in your expression

RangeSum(Sum({<Product_id -= {126}>}Measure), Sum({<Product_id = {126}, Year = {'<2016'}>} Measure))