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

Announcements
Qlik GA: Multivariate Time Series in Qlik Predict: Get Details
cancel
Showing results for 
Search instead for 
Did you mean: 
rathnam_qv
Creator
Creator

script from DB2 Expression


Hi all,

i have the following

sum((case when RAM_GEO_INC_SEG ='L'or  RAM_GEO_INC_SEG ='M' then 1 else 0 end) +(case when coalesce(BORROWER_SEG,RAM_GEO_BORROWER_INC_SEG) ='L' or  coalesce(BORROWER_SEG,RAM_GEO_BORROWER_INC_SEG) ='M'then 1 else 0 end) STB_CRA_CNT

can any send me Script for this please...it's urgent

Thnaks in advncae!!!!
Smiley

4 Replies
rajeshvaswani77
Specialist III
Specialist III

Hi Smiley,

Below should work.

sum(if((RAM_GEO_INC_SEG ='L'or  RAM_GEO_INC_SEG ='M'),1,0))

thanks,

-RV

rathnam_qv
Creator
Creator
Author

Hi Rajesh,

Thanks for ur replay,

but i want script for all the sql which i have mentioned above

rajeshvaswani77
Specialist III
Specialist III

sum(if((RAM_GEO_INC_SEG ='L'or  RAM_GEO_INC_SEG ='M'),1,0) + if(isnull(BORROWER_SEG),if(RAM_GEO_BORROWER_INC_SEG='L',1,0),if(BORROWER_SEG='L',1,0)) OR if(isnull(BORROWER_SEG),if(RAM_GEO_BORROWER_INC_SEG='M',1,0),if(BORROWER_SEG='M',1,0)))

Gysbert_Wassenaar
Partner - Champion III
Partner - Champion III

To begin with if you have a working sql statement you can simply reuse that in Qlikview:

MyTable:

SELECT xxx from yyy ...etc;

This way you don't have to convert the sql to Qlikview script.

But if you really want or need to... try this:

sum(

    if(match(RAM_GEO_INC_SEG,'L','M'),1,0) +

    if(alt(match(BORROWER_SEG,'L','M'),match(RAM_GEO_BORROWER_INC_SEG,'L','M')),1,0)

) as STB_CRA_CNT



talk is cheap, supply exceeds demand