Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Create two conditions in the "Edit Script " QlikView, example:
I created one that has only one condition and it worked right
IF (NUM ([COD. COMPANY]) = 11, 'COMPANY 1 '
IF (NUM ([COD. COMPANY]) = 14, 'COMPANY 2'
IF (NUM ([COD. COMPANY]) = 18 'COMPANY 3 ',))) AS WORK
BRANCH
I wanted one with two conditions that would look like this phenomenon, is cod. company = 11 and cod.branch = 517 then COMPANY 517
if anyone can help me.
thanks
Hello,
This syntax should work
If(Num([COD. COMPANY]) = 11 AND BRANCH = 517,
517, // When condition is true
If(Num([COD. COMPANY]) = 11 AND BRANCH = 518, // When condition is false, nest a new If()
518,
'Other')
) AS COMPANY
Anyway, depending on your data model there might be some easier solution, probably using mapping tables, joins and so. Having complex conditionals may perform really poor and it make the script to take longer to load.
Hope that helps.
BI Consultant
Looks to me like you need a comma at the end of the first 2 lines, and a value for when COD. COMPANY is not 11,14 or 18
Try this:
IF (NUM ([COD. COMPANY]) = 11, 'COMPANY 1 '
IF (NUM ([COD. COMPANY]) = 14, 'COMPANY 2'
IF (NUM ([COD. COMPANY]) = 18 'COMPANY 3 ',
if(NUM ([COD. COMPANY]) = 11 and num(cod.branch) = 517 , 'COMPANY 517'
))) ) AS WORK
Hello,
This syntax should work
If(Num([COD. COMPANY]) = 11 AND BRANCH = 517,
517, // When condition is true
If(Num([COD. COMPANY]) = 11 AND BRANCH = 518, // When condition is false, nest a new If()
518,
'Other')
) AS COMPANY
Anyway, depending on your data model there might be some easier solution, probably using mapping tables, joins and so. Having complex conditionals may perform really poor and it make the script to take longer to load.
Hope that helps.
BI Consultant
Hello Johan, I need two conditions even
Thanks to all who somehow tried to help me, it worked just fine Miguel.