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

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Filter

Hello,

I want to filter for the following, can one of you let me know if there is a way to do this.

If((Flag = 1 and Year = 2013) and (Flag = 0 and Year =2014), Sum(sales))

I'm not sure how to do this in Qlikview.

Thanks

10 Replies
sushil353
Master II
Master II

Hi,

Try this:

sum({<Flag={'1'}>*<Flag={'2013'}>*<Flag={'0'}>*<Year={'2014'}>}sales)

HTH

Sushil

sujeetsingh
Master III
Master III

Where you want to filter?

If it is at UI level you can derieve a flag in Script and provide the Flag as Filter.

Anonymous
Not applicable
Author

You can try this:

=sum(if(Flag=1 and Year=2013,Sales,if(Flag=0 and Year=2014,Sales)))

ThornOfCrowns
Specialist II
Specialist II

(Flag = 1 and Year = 2013) and (Flag = 0 and Year =2014) is a contradiction, Flag cannot be 1 and 0, Year cannot be 2013 and 2014.

Not applicable
Author

I believe, you should do it sum them separately:

If((Flag = 1 and Year = 2013) and (Flag = 0 and Year =2014), Sum(sales))

sum({<Flag={1},Year={2013}>}sales) + sum({<Flag={0},Year={2014}>}sales)

OR

sum({<Flag={1},Year={2013}>+<Flag={0},Year={2014}>}>}sales)

Hope this was helpful

Thanks,

Singh

Not applicable
Author

Wouldn’t this be equal to

Where Flag = 1 and Year = 2013 and Flag = 0 and Year = 2014? I’m expecting Where (Flag = 1 and Year = 2013) and (Flag = 0 And Flag = 2014)

Not applicable
Author

Filter an expression.

Not applicable
Author

James

Below is the example

Client Year Flag

12345 2013 1

12345 2014 0

12346 2013 1

12346 2014 1

I want to identify only Client 12345. Is there any way to identify that client in Qlikview?

Thanks

Venkatachalam.N

Anonymous
Not applicable
Author

Use this:
Only({<Flag={1},Year={2013}>}Client) + Only({<Flag={0},Year={2014}>}Client)