Skip to main content
Announcements
SYSTEM MAINTENANCE: Thurs., Sept. 19, 1 AM ET, Platform will be unavailable for approx. 60 minutes.
cancel
Showing results for 
Search instead for 
Did you mean: 
Hariprasath2394
Partner - Contributor III
Partner - Contributor III

Only if condition - Only 'x' but not 'y' or 'z' expression

I am trying to show values only that is in 2020 year but not in the year 2018 or 2019.

Example, Below shows the customer, year, and Sales. I want to show the Customer and Sales value only if it is in year 2020 but not in 2018 or 2019.

Customer

Year

Sales

Italy

2018

1000

Italy

2019

500

Italy

2020

200

Germany

2019

600

Germany

2020

700

Spain

2020

400

France

2020

300

 

Expected output:

Customer

Year

Sales

Spain

2020

400

France

2020

300

 

I tried giving below expression in calculated dimension for customer value:

If (year = '2020' and year <> '2018' and year <>'2019', customer, null())

and given the year and sales in expression but it is not working as it gives all the 2020 value. I need to show the value only if it in year 2020 but not in 2018 or 2019. Can anyone please tell me the expression that I can give to show the value ''only if 2020 but not if 2018 or 2019''?

16 Replies
Hariprasath2394
Partner - Contributor III
Partner - Contributor III
Author

Hi @sunny_talwar yes adding customer did not give me the expected result. I am using Qlikview version 11

sunny_talwar

Oh wow, you have not upgraded to QV12 yet? That might be the reason.

Hariprasath2394
Partner - Contributor III
Partner - Contributor III
Author

Not me but my company 😊. The management is in contact with the suppliers to buy QlikSense.

sunny_talwar

@Hariprasath2394  well that is what I meant. It will be a big transition from QV11 to QlikSense.

Hariprasath2394
Partner - Contributor III
Partner - Contributor III
Author

Thank You @sunny_talwar . I have a new problem now. I have given the customer number, Customer name and year in the dimension and gave the expression what we discussed in the expression. Please find the below screenshot. This table is showing me the Order value of customers only in 2020 but not in 2019 or 2018.

Hariprasath2394_1-1601554341902.png

IF a select a particular customer, it should show only that customer's value right? For example, if I select the second customer 'IGE Industre', the table should show me only the order value of that specific customer right? Instead if I select that, the table gives me all the 2020 customer list. You have any idea why? Can you please help me? See the below screenshot, the table is showing Order total value for all the 2020 customers.

Hariprasath2394_2-1601554513066.png

sunny_talwar

@Hariprasath2394 This seems like an unrelated issue, do you mind opening a new thread for this?

Hariprasath2394
Partner - Contributor III
Partner - Contributor III
Author

@sunny_talwar sure no Problem