Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Set Analysis

Hi Guys

I have a table say  with the following fields

ID,Date1,Date2

i want to change my expression : Count(if(Date1 = Date2,ID))

into Set Analysis....

Is it possible???

1 Solution

Accepted Solutions
Gysbert_Wassenaar

You can, but why do you want that?

I think the set analysis expression would be:  count( {<[Date1]={"=[Date1]=[Date2]"}>} ID)


talk is cheap, supply exceeds demand

View solution in original post

3 Replies
Gysbert_Wassenaar

You can, but why do you want that?

I think the set analysis expression would be:  count( {<[Date1]={"=[Date1]=[Date2]"}>} ID)


talk is cheap, supply exceeds demand
v_iyyappan
Specialist
Specialist

Hi,

Try like this

= Count({<DateFieldNum1={'=$(=Num(DateFieldNum2))'} ID)

Where

In Script

DateFieldNum1 = Floor(Num(DateFieldNum1))

DateFieldNum2 = Floor(Num(DateFieldNum2))

Regards,

johnw
Champion III
Champion III

I wouldn't do it with the if OR with set analysis.  For performance, I'd suggest setting a counter in the script load like this:

if(Date1 = Date2, 1) as "Dates Equal Counter",

Or possibly more generally useful, as it could be used as a chart dimension, for instance, to only show IDs where the dates are equal:

if(Date1 = Date2, ID) as "Dates Equal ID",

Then experiment to find out which of the following is faster:

count("Dates Equal ID")
sum("Dates Equal Counter")

Different QlikView versions have differed in that regard.