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: 
lucasdavis500
Creator III
Creator III

Using IF condition where the criteria is NE

I have a fairly large condition I'm trying to create for a text object, but I cannot get my Set Analysis or IF(NOT) functions to work properly.

Basically, what I have done is created a variable called Response Time in my data. I had a column with strings/numbers, and needed all of the values to be numeric, for calculation purposes, so I created a code for the strings, I.E. '1000' and '1001. None of my values will ever reach these numbers, so it's safe to keep them as codes.

I'm trying to do create some text objects based on calculations done on ALL of the values EXCEPT for the codes I created.

I.E., at a simple level:

=SUM({<[Response Time] -= {'1000','1001'}>} [Response Time]) / COUNT({<[Response Time] -= {'1000','1001'}>} [Response Time])

I want '1000' and '1001' excluded. I've also tried:

=(if(Not wildmatch([Response Time], '1000', '1001'), SUM([Response Time])) / (COUNT(Pkey)))

which returns '-'

The first formula is resolving, but it seems they it is keeping the '1000' and '1001' codes in the calculations, because the numbers generated are >100, which I know is not true, and the second returns NULL... am I missing something in the usage of if(Not wildmatch)?

12 Replies
lucasdavis500
Creator III
Creator III
Author

Why must you include interval? this didn't seem to work...

I also changed IF(ResolutionDate='Null',IF(MaxDateCreated-DateCreated>30, '1000', '1001'),ResolutionDate-DateCreated) AS ResponseTime

to

IF(ResolutionDate='Null',IF(MaxDateCreated-DateCreated>30, 1000, 1001),ResolutionDate-DateCreated) AS ResponseTime

taking away the single quotes around 1000 and 1001...still doesn't seem to resolve the issue...

sunny_talwar

All I was trying to do was to make sure that 1000 is 1000 and not 1000.0000000001 and same for the 1001

lucasdavis500
Creator III
Creator III
Author

=NUM((SUM(IF([Response Time] < 1000, [Response Time])) + SUM(IF([Other Response Time] < 1000, [Other Response Time]))) / (COUNT(Pkey) + COUNT([Other Control Number])), '#,##0.00')

Seemed to do the trick....