Qlik Community

QlikView Creating Analytics

Discussion Board for collaboration related to Creating Analytics for QlikView.

Not applicable

Set Analysis Count If?

I would like this equation translated into Set Analysis.  This should be fairly straight forward but all the examples show X field is equal to 'X, X.' I am unable to find the correct syntax for an if statement with a comparison.

If today’s < greater than the assigned to date count the number of tickets regardless ofany other selections.

=count(if(num(vToday)<num(ASSIGNEDDATE), (TICKETID)))

Let me know if you have any other questions.

Thanks.

Tags (4)
1 Solution

Accepted Solutions
mov
Esteemed Contributor III

Re: Set Analysis Count If?

No need for if.  Or youcan use if witout set.  You have to use the example from Karl, but with

ASSIGNEDDATE_NUM

count({$<ASSIGNEDDATE_NUM={">$(vToday"}> TICKETID)

13 Replies
pover
Honored Contributor

Set Analysis Count If?

Try

count({$<ASSIGNEDDATE={">$(vToday)"}> TICKETID)

Karl

Not applicable

Set Analysis Count If?

This did not work but I think you are on the right track.  Just a matter of getting the syntax correct.

pover
Honored Contributor

Set Analysis Count If?

I don't know what vToday is, so try,

count({$<ASSIGNEDDATE={">$(=today())"}> TICKETID)

Not applicable

Set Analysis Count If?

vToday was just a variable made for today.  I tried today() still does not work.

mov
Esteemed Contributor III

Set Analysis Count If?

Unlike "if", set analysis is sensitive to the date format.  To work, both ASSIGNEDDATE and today() (or vToday) must be in the same format.

pover
Honored Contributor

Set Analysis Count If?

Ok, it should work.  If you need more help, it will be easier if you can upload a small, sample qvw of your data.

Karl

Not applicable

Set Analysis Count If?

Yes I attempted this as well. 

I am attempting to show how many tickets were opened on todays date.  So assigned date for each ticket.  I converted =num(assigneddate) AS ASSIGNEDDATE_NUM.  vToday is also defined in my load script as a num value.  See both text boxes below to view values.  TICKETID is just as the name applies.

qvdate.PNG

Not applicable

Re: Set Analysis Count If?

I have now taken assigneddate in my load script this:

floor(num(ASSIGNEDDATE)) AS ASSIGNEDDATE_NUM,

This now converts all assigned to dates to be equal to todays date.  Just playing the the syntax again in set analysis.   Will post if I get it working.

mov
Esteemed Contributor III

Set Analysis Count If?

You need to use ASSIGNEDDATE_NUM in your set instead of ASSIGNEDDATE

Community Browser