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

script conversion

Hi can someone please help with the script conversion below?

////        CASE WHEN(CASE WHEN "HOURLY_SALES_TQ"."HS_MMO_FINANCE_HOUSE" = 'No Vehicle'

////                       OR "HOURLY_SALES_TQ"."HS_QUO_CONFIRMED_PROD" IN (1747, 1749) THEN 0

////                       ELSE 1 END) = 1 THEN "HOURLY_SALES_TQ"."HS_MMO_FINANCE_HOUSE"

////        END AS "Finance House1",

am doing something like below but still giving errors

   

If (("HS_MMO_FINANCE_HOUSE" = 'No Vehicle' OR match("HS_QUO_CONFIRMED_PROD",1747, 1749)) ,0, 1) = 1), "HOURLY_SALES_TQ"."HS_MMO_FINANCE_HOUSE") AS "Finance House1",

2 Replies
Not applicable
Author

Hi,

if(If(HOURLY_SALES_TQ"."HS_MMO_FINANCE_HOUSE= 'No Vehicle' OR

match("HS_QUO_CONFIRMED_PROD",'1747', '1749'), 0,1))=1, "HOURLY_SALES_TQ"."HS_MMO_FINANCE_HOUSE") as Finance House1

Try this, I didn't check whether it work or not?

Regards,

Kabilan K.

jonathandienst
Partner - Champion III
Partner - Champion III

Hi

You can simplify the logic to this:

If(Not(HS_MMO_FINANCE_HOUSE = 'No Vehicle' Or Match(HS_QUO_CONFIRMED_PROD, '1747', '1749')),

          HS_MMO_FINANCE_HOUSE

) As [Finance House1],

I assumed that you are not keeping the SQL fully qualified names in your QV model. If you are, then the above would be:

If(Not(HOURLY_SALES_TQ.HS_MMO_FINANCE_HOUSE = 'No Vehicle' Or Match(HOURLY_SALES_TQ.HS_QUO_CONFIRMED_PROD, '1747', '1749')),

          HOURLY_SALES_TQ.HS_MMO_FINANCE_HOUSE

) As [Finance House1],

This statement (and your SQL above) return a null when the condition is met and a value when the condition is not met. Is this what you require?

Regards

Jonathan

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein