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

Announcements
Learn how to migrate to Qlik Cloud Analytics™: On-Demand Briefing!
cancel
Showing results for 
Search instead for 
Did you mean: 
nevilledhamsiri
Specialist
Specialist

How to arrange the age bracket in an ascending order

As can be seen, age brackets are jumbled here & there. Though I adjust the load order with text & numeric value both, expected results wont come!

Please help me on this!

Rgds

Neville

LOAD BRANCH,

     CLASS_CODE,

     PICK(MATCH( CLASS_CODE,'MC','M4','M3')+1,'NON_MOTOR','MOTOR','MOTOR','MOTOR')AS MO_NM_REFUNDS,

     PRODUCT_CODE,

     POLICY_NO,

     NAME_OF_INSURED,

     CREDIT_NOTE_NO,

     CREDIT_NOTE_DATE,

     PERIOD_FROM,

     IF(CREDIT_NOTE_DATE-PERIOD_FROM>120,'>120',

     IF(CREDIT_NOTE_DATE-PERIOD_FROM>90,'>90',

     IF(CREDIT_NOTE_DATE-PERIOD_FROM>60,'60-90',

     IF(CREDIT_NOTE_DATE-PERIOD_FROM>30,'30-60','0-30')))) AS AGE_BRACKET,

     PERIOD_TO,

     REFUND_PREMIUM,

     ADDRES,

     REASON,

     FINANCIAL_INTEREST,

     ME_CODE,

     ME_NAME,

//     SD_REASON,

//     [SD_YEAR(1)],

//     [SD_YEAR(2)],

//     NEW_RENEWALS,

//     MO_NM,

//     [GROSS_PREMIUM (MES)],

//     [ME_NAME+CODE],

//     Branch_Premium_Motor,

//     [Branch_Premium_Non Motor],

//     [CRED MO],

//     FROM,

//     F27,

//     [Refunded Month],

//     [Period from Month],

//     F30,

//     Month_From,

//     Month_Cre,

//     len,

//     ye,

//    

     Year(Date#(If(Len(POLICY_NO) = 15, Mid(POLICY_NO, 5, 2), If(Len(POLICY_NO) = 14, Mid(POLICY_NO, 5, 2), Left(POLICY_NO, 2))), 'YY')) as Year

FROM

[..\REFUND_REGISTER (TOTAL).xlsx]

(ooxml, embedded labels, table is Source_Data);

1 Solution

Accepted Solutions
rubenmarin

Hi Neville, you can crete a field age and use this to sort values:

CREDIT_NOTE_DATE-PERIOD_FROM as Age


Sort expression:

Min({1} Age)


or directly try with:

Min({1} CREDIT_NOTE_DATE-PERIOD_FROM)

View solution in original post

2 Replies
rubenmarin

Hi Neville, you can crete a field age and use this to sort values:

CREDIT_NOTE_DATE-PERIOD_FROM as Age


Sort expression:

Min({1} Age)


or directly try with:

Min({1} CREDIT_NOTE_DATE-PERIOD_FROM)

nevilledhamsiri
Specialist
Specialist
Author

Hi, Ruben,

Thanks a lot! It woks fine

Regds

Neville