Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
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",
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.
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