Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Join us to spark ideas for how to put the latest capabilities into action. Register here!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Combining 2 statements into 1

Hi!, currently there is an expression that is made based on an IF statement, now I am willing to switch it into a single straight condition, but I can seem to make it work.

Any suggestions?

Current Logic:

If(

//1-

Sum(

{$<IsInQueue={1}>}ContactDurationQH >=(ServiceLevelAgreement*1000) 

)

,

//2-

Count(

{$<

UseServiceLevelThreshold        =        {1},

ContactStateID                                =        {1},

ContactDirection                            =        {1},

OutboundSkill                                 =        {0},

ContactStartDate                           =        {">=$(varCalendarStartDateTZ)<$(varCalendarEndDateTZ)"}

>}

DistinctContactID)

,

0

)

Desired result:

//1

Count(

{$<

UseServiceLevelThreshold        =        {1},

ContactStateID                                =        {1},

ContactDirection                        =        {1},

OutboundSkill                              =        {0},

ContactStartDate                        =        {">=$(varCalendarStartDateTZ)<$(varCalendarEndDateTZ)"},

ContactID                                        =     {"Sum({$<IsInQueue={1}>}ContactDurationQH >=(ServiceLevelAgreement*1000))"}<<<<<------ ERROR

>}

DistinctContactID

)

How can I combine this logic into the set analysis filtering?

So the Sum of ContactDurationQH, of the IsInQueue Records, is also greater than the ServiceLevelAgreement*1000 ???

Thanks in advance for your time.

-Ed

1 Reply
Not applicable
Author

After giving it a littler more effort I think I got it working:

Count(

          {$<

                    UseServiceLevelThreshold          =          {1},

                    ContactStateID                                        =          {1},

                    ContactDirection                              =          {1},

                    OutboundSkill                                        =          {0},

                    ContactStartDate                              =          {">=$(varCalendarStartDateTZ)<$(varCalendarEndDateTZ)"},

                    ContactID                                                   =          {"=Sum({$<IsInQueue={1}>}ContactDurationQH) >=(ServiceLevelAgreement*1000)"}

          >}

Distinct ContactID)

This syntax is working now, but still I am open to any kind of suggestion, maybe on performance?

Thanks!

-ed