Qlik Community

QlikView App Dev

Discussion Board for collaboration related to QlikView App Development.

Announcements
QlikWorld happening right now! You can still join: REGISTER NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Chanty4u
MVP
MVP

Re:Time

hi ,

Need help.

PFA

my reuirment is from  ORDER_BOOK  field i want above 60min between10&30min,between 30&45min

using if Else condition ony nt usng interval match fun

Thank you

suresh

1 Solution

Accepted Solutions
jagan
Partner
Partner

Hi,

Try this script

LOAD SI_NUMBER,

     HEADER_ID,

     LOCATION_NAME,

     REQ_CREATION_DATE,

     ORD_CREATION_DATE,

     OSN_TIME,

     REQ_TO_ORD_CREATE_TIME_MINS,

     ORDER_BOOK_TO_OSN_TIME,

     TAT,

     If(ORDER_BOOK_TO_OSN_TIME <10, '<10',

  If(ORDER_BOOK_TO_OSN_TIME >= 10 and ORDER_BOOK_TO_OSN_TIME < 30, '10-30',

          If(ORDER_BOOK_TO_OSN_TIME >= 30 and ORDER_BOOK_TO_OSN_TIME < 45, '30-45',

               '>=45'))) AS TimeRange

FROM

(ooxml, embedded labels, table is [between 10 & 30 minutes]);

Regards,

Jagan.

View solution in original post

10 Replies
MK_QSL
MVP
MVP

These 60 min, 10-30 min are duration?

Provide some more info.

Chanty4u
MVP
MVP
Author

hi manish

yes duration only.

MK_QSL
MVP
MVP

My question is how your will get those duration?

Have you calculated in script?

are they field values or difference of two timestamps?

Chanty4u
MVP
MVP
Author

in script part only done..no same timestamps.

just i wan the condition usng  if else

MK_QSL
MVP
MVP

If(Duration < 10, '<10',

     If(Duration >= 10 and Duration < 30, '10-30',

          If(Duration >= 30 and Duration < 45, '30-45',

               '>=45')))

or

Aggr(If(Duration < 10, '<10',

     If(Duration >= 10 and Duration < 30, '10-30',

          If(Duration >= 30 and Duration < 45, '30-45',

               '>=45'))), ORDER_BOOK) 

sasiparupudi1
Master III
Master III

Please provide sample data

Chanty4u
MVP
MVP
Author

hi

i want in pivot table

PFA

jagan
Partner
Partner

Hi,

You can use If condition for this, IntervalMatch() is not suitable for this scenario.  Try like below

LOAD

*,

If(Duration <10, '<10',

If(Duration >= 10 and Duration < 30, '10-30',

          If(Duration >= 30 and Duration < 45, '30-45',

               '>=45'))) AS TimeRange

FROM DataSource;

Hope this helps you.

Regards,

Jagan.

jagan
Partner
Partner

Hi,

Try this script

LOAD SI_NUMBER,

     HEADER_ID,

     LOCATION_NAME,

     REQ_CREATION_DATE,

     ORD_CREATION_DATE,

     OSN_TIME,

     REQ_TO_ORD_CREATE_TIME_MINS,

     ORDER_BOOK_TO_OSN_TIME,

     TAT,

     If(ORDER_BOOK_TO_OSN_TIME <10, '<10',

  If(ORDER_BOOK_TO_OSN_TIME >= 10 and ORDER_BOOK_TO_OSN_TIME < 30, '10-30',

          If(ORDER_BOOK_TO_OSN_TIME >= 30 and ORDER_BOOK_TO_OSN_TIME < 45, '30-45',

               '>=45'))) AS TimeRange

FROM

(ooxml, embedded labels, table is [between 10 & 30 minutes]);

Regards,

Jagan.