Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

regarding or condition

DEAR TEAM  I HAVE ONE DOUBT PLEASE FIND BELOW

                                   YEAR1             YEAR2

customer name             sales               sales

ABC                            2000               25000

XYZ                             3000                 4000

LMN                            5000                6000

FROM THIS I WANT SUM OF SALES  WHEN CUSTOMER IS ABC OR XYZ

9 Replies
swuehl
MVP
MVP

sum({<[customer name] = {'ABC', 'XYZ'}>} SALES)

anbu1984
Master III
Master III

Sum(If([Customer name] = 'ABC' Or [Customer name] = 'XYZ',Sales))

Not applicable
Author

thanks its working

MK_QSL
MVP
MVP

Use below in script

===============

CrossTable(Year, Sales)

Load * Inline

[

    customer name, YEAR1 sales, YEAR2 sales

  ABC, 2000, 25000

  XYZ, 3000, 4000

  LMN, 5000, 6000

];

=====================

Use below in text box (Same as suggested by Stefan)

=SUM({<[customer name] = {'ABC','XYZ'}>}Sales)

anbu1984
Master III
Master III

Can you mark posts Anwered/Helpful?

ThornOfCrowns
Specialist II
Specialist II

Please make sure you reply to both of your threads, this one and http://community.qlik.com/thread/116940 to make sure that everything ties up neatly.

Also, in future could you please try to not re-ask the same question in different threads?

Regards,

James.

Not applicable
Author

HI HOW TO USE AND CONDITION OF THIS INCASE OF OR

anbu1984
Master III
Master III

Replace Or by And

Sum(If(Field1 = 'ABC' And Field2 = 'XYZ',Sales))

anbu1984
Master III
Master III

Do you mean you want to use And in this condition "[Customer name] = 'ABC' Or [Customer name] = 'XYZ'"?