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

Difference between date

Hi, i need to represent time how many tickets have been solved the last month, within x days (a variable called vDatSet) from support request and time to solve problem.

I've tried to :

if((date([Solution])-date([OpenTicket]))<=$(vDaySet),count(distinct ID_Ticket))

but I dont' understand how set date on last month and how match set analysis and if condition.

Help me pls.

Can

1 Solution

Accepted Solutions
m_woolf
Master II
Master II

Try:

count(distinct if((date([Solution])-date([OpenTicket]))<=$(vDaySet),ID_Ticket))

View solution in original post

4 Replies
m_woolf
Master II
Master II

Try:

count(distinct if((date([Solution])-date([OpenTicket]))<=$(vDaySet),ID_Ticket))

jonathandienst
Partner - Champion III
Partner - Champion III

Assuming Solution and OpenTicket are true (numeric) date fields and vDaySet is a number, then this should work:

=Count(If(Solution - OpenTicket <= vDaySet, Distinct ID_Ticket))

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein
Mark_Little
Luminary
Luminary

Hi,

Another possibly approach would be to add a days to resolve field in the script.

then Count({<DaystoResolve={'<=$(vDaySet)'}>}Distinct ID_Ticket)

Mark

jonathandienst
Partner - Champion III
Partner - Champion III

If that does not work, it may be that your "date" fields are actually strings and/or mat contain a date component.

Sum(If()) expressions can perform poorly on large data sets, so you may want to create a derived variable, something like this:

LOAD

     ...

     Solution - OpenTicket As Offset,

     Solution,

     OpenTicket,

     ...

Then you can use a set expression (which should perform much better):

Count{<Offset = {"<=$(vDaySet)"}>} Distinct ID_Ticket)

For more detailed help, please upload a representative sample qvw file.

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein