Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Select case

Hi,

I'm trying to convert this case code to Qlikview, could I please get assistance.

CASE

  when MAC_CODE = 963 then ''SNL''

  Else ''MLOAN''

END as PRODUCT_CODE

CASE when REGISTRATION_MONTH_CODE = ''NOTREG''

  then ''N''

  else

  CASE when ( year(INFORMATION_DATE)*100 + month(INFORMATION_DATE) )

  else ''N''

  END as  REG_LAST_3MONTHS_IND

CASE when FINAL_ML_AMT <= 50000   then  ''A''

  when FINAL_ML_AMT <= 100000  then  ''B''

  when FINAL_ML_AMT <= 150000  then  ''C''

  when FINAL_ML_AMT <= 350000  then  ''D''

  when FINAL_ML_AMT <= 700000  then  ''E''

  else ''F''

END as MLOANS_BANDS_CODE

12 Replies
Not applicable
Author

Could you perhaps demonstrate how I would execute this on both scenarios please?

sinanozdemir
Specialist III
Specialist III

In the front-end since you have case else, then you can put the IF statement within your function or by using set analysis:

Sum(If(MAC_CODE = 963, Amount)) or Sum({<MAC_CODE = {963}>} Amount)

Not applicable
Author

this is the chart I'm trying to produce:

Rand Value is the sum of that the nested if

Number is the count of the nested if

Final.jpg