Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Announcements

Breathe easy -- you now have more time to plan your next steps with Qlik!
QlikView 11.2 Extended Support is now valid through December 31, 2020. Click here for more information.

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
Not applicable

Re: Set Analysis

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
3 Replies
Gysbert_Wassenaar
Not applicable

Re: Set Analysis

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
Not applicable

Re: Set Analysis

Hi,

Try like this

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

Where

In Script

DateFieldNum1 = Floor(Num(DateFieldNum1))

DateFieldNum2 = Floor(Num(DateFieldNum2))

Regards,

johnw
Not applicable

Re: Set Analysis

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.