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

Help create flags in script

Hello,

I have a simple data table as shown below:

F11F21Candidate 1Candidate 2Candidate 3Candidate 4Candidate 5Candidate 6Candidate 7Candidate 8
No of CV Required
11111111
CV Submitted by Bidder
11111000
Personal Detail
Is Employee's status in Bidder's Company currently Permanent?
YESYESNOYESYES
Education Background
Select Secondary Qualification/Education Level
L2L1L1L1
Working Experiences
Total Working Experience
54678
Supporting Documents
Have you submitted documents
YESYESYESYESYES
Supporting Documents
Have you submitted - Candidate’s Education Certificate
YESNOYESYESYES

I'm trying to build flags based on some specific criteria:

1. Flag1 is based on the field 'CV Submitted by Bidder'. If Total Number of CVs submitted by bidder <=5, Fail,Pass.

2. Flag 2 is based on the field 'Is Employee's status in Bidder's Company currently Permanent?'. IF no. of 'YES' responses to this question <5, Fail, Pass.

3. Flag 3 is based on the field Select Secondary Qualification/Education Level . If <5 blank responses, fail, pass.

4. Flag 4 is based on the field Total Working Experience. If 5 Candidates have less than 5 years of experience, then FAIL; less than 7 years of experience, OKAY,else Pass.

5. Flag 5 is based on the field Have you submitted documents. If < 5 responses are "YES", then Fail, else Pass.

6. Flag 6 is based on the field Have you submitted - Candidate’s Education Certificate. If < 5 responses are "YES", then Fail,else Pass.


I have run out of ideas on how I can transform the table to convenience and build all of these flags in the script itself. Please help me with the transformation and the logics for the flags as above. Any help is much much appreciated! Thanks in advance!

stalwar1

18 Replies
mrthomasshelby
Creator III
Creator III
Author

Still gives the same error. Is it because the field has both text and numbers?

sunny_talwar

Can you share the complete script you are running?

thevingo
Creator
Creator

try declaring the field as Dual

mrthomasshelby
Creator III
Creator III
Author

T2:

LOAD A as F11,

    B as F21,

    C as [Candidate 1],

    D as [Candidate 2],

    E as [Candidate 3],

    F as [Candidate 4],

    G as [Candidate 5],

    H as [Candidate 6],

    I as [Candidate 7],

    J as [Candidate 8]

FROM

[*Book1.xlsx]

(ooxml, no labels, header is 3 lines, table is [APPENDIX V (G)]);

T2_1:

CrossTable(Criteria,Responses,2)

Load

F11 as F12,

F21 as F22,

[ Candidate 1],

    [Candidate 2],

    [Candidate 3],

    [Candidate 4],

    [Candidate 5],

    [Candidate 6],

    [Candidate 7],

    [Candidate 8]

Resident T2;

T2_2:

Load *,

If(Sum(If(F22 = 'CV Submitted by Bidder', Responses)) <= 5, 'Fail', 'Pass') as Flag15

Resident T2_1;

Drop Table T2_1;

sunny_talwar

May be try this

T2:

LOAD A as F11,

    B as F21,

    C as [Candidate 1],

    D as [Candidate 2],

    E as [Candidate 3],

    F as [Candidate 4],

    G as [Candidate 5],

    H as [Candidate 6],

    I as [Candidate 7],

    J as [Candidate 8]

FROM

[*Book1.xlsx]

(ooxml, no labels, header is 3 lines, table is [APPENDIX V (G)]);

T2_1:

CrossTable(Criteria, Responses,2)

Load

F11 as F12,

F21 as F22,

[ Candidate 1],

    [Candidate 2],

    [Candidate 3],

    [Candidate 4],

    [Candidate 5],

    [Candidate 6],

    [Candidate 7],

    [Candidate 8]

Resident T2;

DROP Table T2;

Left Join (T2_1)

Load Criteria,

    If(Sum(If(F22 = 'CV Submitted by Bidder', Responses)) <= 5, 'Fail', 'Pass') as Flag15

Resident T2_1

Group By Criteria;

mrthomasshelby
Creator III
Creator III
Author

I'm not sure if that is what is required Sunny. Basically, Flag15 is defined as 'Pass' if total number of 'CV Submitted by Bidder' is >5 counting from Candidates 1 through Candidate 8 else Fail.

sunny_talwar

May be this?

T2:

LOAD A as F11,

    B as F21,

    C as [Candidate 1],

    D as [Candidate 2],

    E as [Candidate 3],

    F as [Candidate 4],

    G as [Candidate 5],

    H as [Candidate 6],

    I as [Candidate 7],

    J as [Candidate 8]

FROM

[*Book1.xlsx]

(ooxml, no labels, header is 3 lines, table is [APPENDIX V (G)]);

T2_1:

CrossTable(Criteria, Responses,2)

Load

F11 as F12,

F21 as F22,

[ Candidate 1],

    [Candidate 2],

    [Candidate 3],

    [Candidate 4],

    [Candidate 5],

    [Candidate 6],

    [Candidate 7],

    [Candidate 8]

Resident T2;

DROP Table T2;

Left Join (T2_1)

Load If(Sum(If(F22 = 'CV Submitted by Bidder', Responses)) <= 5, 'Fail', 'Pass') as Flag15

Resident T2_1;

mrthomasshelby
Creator III
Creator III
Author

Yes. This was the way to go as I just found out myself! Thanks for your time Sunny! Really really appreciate it!

sunny_talwar

No problem

Please close the thread by marking correct and helpful responses.

Best,

Sunny