Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Dear All,
I have an issue in my project where I have total 10 values in a particular field.Based on this field i need to create 2 values where in 1st value will contain 5 records and 2nd value will contain all 10 records,which includes 5 records of the 1st value as well.Kindly let me know how to handle this situation.I tried using IF.....Else but it does`nt work as required.
My code Sample:
If(WildMatch(FINANCE_LOB, 'MOTOR-2W','MOTOR-4W','MOTOR-GCV','MOTOR-MISC','MOTOR-PCV'), 'Motor - OD',
If(WildMatch(FINANCE_LOB,'MOTOR-2W','MOTOR-4W','MOTOR-GCV','MOTOR-MISC','MOTOR-PCV','MOTOR-STANDALONE - 2W','MOTOR-STANDALONE - CV','MOTOR-STANDALONE - MISC', 'MOTOR-STANDALONE - MISC','MOTOR-STANDALONE - PVT'), 'Motor - TP')) AS Finance_LOB_New
Eagerly waiting for your help !!! Thank you...
Kind Regards,
Ranjan Poojary
Dear All,
Thank you very much for your valuable suggestions and ideas.
I resolved this issue by mapping Motor-OD and Motor-TP according to their corresponding values in Finance_LOB field.
Excel sample for your reference is given below :
FINANCE_LOB | FINANCE_LOB_F_U |
MOTOR-2W | Motor - OD |
MOTOR-4W | Motor - OD |
MOTOR-GCV | Motor - OD |
MOTOR-MISC | Motor - OD |
MOTOR-PCV | Motor - OD |
MOTOR-2W | Motor - TP |
MOTOR-4W | Motor - TP |
MOTOR-GCV | Motor - TP |
MOTOR-MISC | Motor - TP |
MOTOR-PCV | Motor - TP |
MOTOR-STANDALONE - 2W | Motor - TP |
MOTOR-STANDALONE - CV | Motor - TP |
MOTOR-STANDALONE - PVT | Motor - TP |
MOTOR-STANDALONE -MISC | Motor - TP |
MOTOR-STANDALONE - MISC | Motor - TP |
Thank you once again...
Kind Regards,
Ranjan Poojary
ddi u try this enclosing in [MOTOR-STANDALONE - MISC]
maximum wit two words u can include in [] braces and give a try
I would use a mapping table ApplyMap ‒ QlikView
Dear Ranjan,
let´s think about using your if-statement:
If the field FINANCE_LOB contains the value "MOTOR-2W", then both the if and else condition are satisfied, i.e. which value should be assigned to the field?
What is the purpose of assigning the same value for all 10 possible values of your field?
Please elaborate the purpose of it. Judging from what you gave us, I guess it would be best if you simply use the first if condition only. Then you write
If(WildMatch(FINANCE_LOB, 'MOTOR-2W','MOTOR-4W','MOTOR-GCV','MOTOR-MISC','MOTOR-PCV'), 'Motor - OD', 'MOTOR-TP') AS Finance_LOB_New
Regards,
Max
You can't have this using the same number of records, you would need to create a table that shows 5 records for your first new value, then 10 records for your second:
LINK:
LOAD
'Motor - OD' as Finance_LOB_New,
FINANCE_LOB
RESIDENT YourTable
WHERE WildMatch(FINANCE_LOB, 'MOTOR-2W','MOTOR-4W','MOTOR-GCV','MOTOR-MISC','MOTOR-PCV');
CONCATENATE (LINK)
LOAD
'Motor - TP' as Finance_LOB_New,
FINANCE_LOB
RESIDENT YourTable
WHERE WildMatch(FINANCE_LOB,'MOTOR-2W','MOTOR-4W','MOTOR-GCV','MOTOR-MISC','MOTOR-PCV','MOTOR-STANDALONE - 2W','MOTOR-STANDALONE - CV','MOTOR-STANDALONE - MISC', 'MOTOR-STANDALONE - MISC','MOTOR-STANDALONE - PVT');
Dear All,
Thank you very much for your valuable suggestions and ideas.
I resolved this issue by mapping Motor-OD and Motor-TP according to their corresponding values in Finance_LOB field.
Excel sample for your reference is given below :
FINANCE_LOB | FINANCE_LOB_F_U |
MOTOR-2W | Motor - OD |
MOTOR-4W | Motor - OD |
MOTOR-GCV | Motor - OD |
MOTOR-MISC | Motor - OD |
MOTOR-PCV | Motor - OD |
MOTOR-2W | Motor - TP |
MOTOR-4W | Motor - TP |
MOTOR-GCV | Motor - TP |
MOTOR-MISC | Motor - TP |
MOTOR-PCV | Motor - TP |
MOTOR-STANDALONE - 2W | Motor - TP |
MOTOR-STANDALONE - CV | Motor - TP |
MOTOR-STANDALONE - PVT | Motor - TP |
MOTOR-STANDALONE -MISC | Motor - TP |
MOTOR-STANDALONE - MISC | Motor - TP |
Thank you once again...
Kind Regards,
Ranjan Poojary