Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
priyarane
Specialist
Specialist

Expression

Hi Community,

How to write expression for below one.

DECODE(SUM(case when bis_entity_type_new in ('INDIV', 'SME_RETAIL', 'SME_EU_RET') and asset_class_new not in ('CLAIM_OTH_100') then 0 else ead end), 0, 0,SUM(case when bis_entity_type_new in ('INDIV', 'SME_RETAIL', 'SME_EU_RET') and asset_class_new not in ('CLAIM_OTH_100') then 0 else ead*k_maturity*365.25 end)/SUM(case when bis_entity_type_new in ('INDIV', 'SME_RETAIL', 'SME_EU_RET') and asset_class_new not in ('CLAIM_OTH_100') then 0 else ead end))

5 Replies
yadav_anil782
Creator II
Creator II

hi,

this is more complex so plz try to share in easy way so we can get your query

priyarane
Specialist
Specialist
Author

But I got it from my users so nothing else I have...

maxgro
MVP
MVP

DECODE(

  SUM( case when bis_entity_type_new in ('INDIV', 'SME_RETAIL', 'SME_EU_RET')

    and asset_class_new not in ('CLAIM_OTH_100')

  then 0

  else ead

  end

  ),

  0, 0,

  SUM( case when bis_entity_type_new in ('INDIV', 'SME_RETAIL', 'SME_EU_RET')

    and asset_class_new not in ('CLAIM_OTH_100')

  then 0

  else ead*k_maturity*365.25

  end

  )

  /

  SUM( case when bis_entity_type_new in ('INDIV', 'SME_RETAIL', 'SME_EU_RET')

    and asset_class_new not in ('CLAIM_OTH_100')

  then 0

  else ead end

  )

)


I try


IF(

  SUM(      if(match(bis_entity_type_new, 'INDIV', 'SME_RETAIL', 'SME_EU_RET')

                        and not match(asset_class_new, 'CLAIM_OTH_100')

                      , 0

                      , ead

                ) =0,

  /* if sum() =0 --> 0*/ 

  0,         

  /* else sum() / sum() */

  SUM(      if(match(bis_entity_type_new, 'INDIV', 'SME_RETAIL', 'SME_EU_RET')

                        and not match(asset_class_new, 'CLAIM_OTH_100')

                      , 0

                      , ead*k_maturity*365.25

                )

      )

/

SUM(          if(match(bis_entity_type_new, 'INDIV', 'SME_RETAIL', 'SME_EU_RET')

                        and not match(asset_class_new, 'CLAIM_OTH_100')

                      , 0

                      , ead

                )

    )         

Gysbert_Wassenaar
Partner - Champion III
Partner - Champion III

Something like this:

alt(sum(ead*k_maturity*365.25*if(match(bis_entity_type_new,'INDIV', 'SME_RETAIL', 'SME_EU_RET') and not match(asset_class_new'CLAIM_OTH_100'),0,1))/sum(if(match(bis_entity_type_new,'INDIV', 'SME_RETAIL', 'SME_EU_RET') and not match(asset_class_new'CLAIM_OTH_100'),ead)),0)


talk is cheap, supply exceeds demand
priyarane
Specialist
Specialist
Author

let me try