Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

writing an "AND" statement in qlikview

Hi guys,

Please I am trying to write a statement in qlikview as follows:

If month = 'Apr' AND month = 'May' then display these period is spring. But I don't know how to write such  a statement in qlikview. Please any help?

Thanks

29 Replies
Not applicable
Author

Hi Sunny,

I have rows with energytypeID 53 and energytypeID  54.  53 means its electricity and 54 gas

sunny_talwar

Right, but a single row cannot be 53 and 54 at the same time? Can it be?

ID, ElectricityTypeID

10, 53

10, 54

vs.

ID, ElectricityTypeID

10, 53|54

Not applicable
Author

Hi Sunnt

Exactly what you demonstrated in the first table

sunny_talwar

So is the goal to flag ElectricityTypeID or ID which include both 53 and 54 ElectricityTypeID?

Not applicable
Author

That's correct ! its the goal

sunny_talwar

On the front end you can use a set analysis in your expression like this:

{<ID = p({<ElectricityTypeID = {53}>})*p({<ElectricityTypeID = {54}>})>}

there are ways to do it in backend also, but for those, I would suggest you to provide a sample of your dataset as the script can change based on how the actual data looks like and I don't want to keep guessing things

sunny_talwar

Sample:

Script

Table:

LOAD * Inline [

ID, ElectricityTypeID, Consumption

1, 53, 10

1, 54, 13

1, 55, 12

2, 53, 10

2, 52, 9

2, 55, 12

3, 53, 10

3, 54, 13

3, 59, 14

4, 53, 16

5, 53, 11

5, 54, 14

5, 59, 9

];

There are 5 IDs, but I want to display only those IDs where there is ElectricityTypeID of 53 and 54

Capture.PNG

Not applicable
Author

Hi Sunny,

I want to display but a message if that particular ID has electricitytypeID 53 and 54.

sunny_talwar

Like this?

Capture.PNG

Not applicable
Author

Sunny,

Please I can't see the complet expression that is displaying the messages