Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Script Coversion help!!!

Can some one help with the following script conversion..  from sq   lPLEASE.

//        CASE WHEN  (CASE WHEN "ACCOUNTTRANSACTIONSET"."ATA_PAID_IND" IS NULL THEN 'No Result'

//                         WHEN "ACCOUNTTRANSACTIONSET"."ATA_PAID_IND" = 'N' THEN 'N'

//                         WHEN "ACCOUNTTRANSACTIONSET"."ATA_PAID_IND" = 'Y' THEN 'Y'

//                    END) = 'No Result' AND  MaxAccTransKey."MAXACCOUNTTRANSACTIONSET_KEY"= "ACCOUNTTRANSACTIONSET"."ACCOUNTTRANSACTIONSET_KEY" THEN 1

//             WHEN  (CASE WHEN "ACCOUNTTRANSACTIONSET"."ATA_PAID_IND" IS NULL THEN 'No Result'

//                         WHEN "ACCOUNTTRANSACTIONSET"."ATA_PAID_IND" = 'N' THEN 'N'

//                         WHEN "ACCOUNTTRANSACTIONSET"."ATA_PAID_IND" = 'Y' THEN 'Y'

//                    END) = 'N' AND MaxAccTransKey."MAXACCOUNTTRANSACTIONSET_KEY" = "ACCOUNTTRANSACTIONSET"."ACCOUNTTRANSACTIONSET_KEY" THEN 1

//             WHEN  (CASE WHEN "ACCOUNTTRANSACTIONSET"."ATA_PAID_IND" IS NULL THEN 'No Result'

//                         WHEN "ACCOUNTTRANSACTIONSET"."ATA_PAID_IND" = 'N' THEN 'N'

//                         WHEN "ACCOUNTTRANSACTIONSET"."ATA_PAID_IND" = 'Y' THEN 'Y'

//                    END) = 'Y' AND MaxAccTransKey."MAXACCOUNTTRANSACTIONSET_KEY" = "ACCOUNTTRANSACTIONSET"."ACCOUNTTRANSACTIONSET_KEY" THEN 1

//             ELSE 0

//        END AS "Summary"

4 Replies
Gysbert_Wassenaar

Well, it's possible to rewrite this. But if it's a working sql statement why not simply use it as it is:

Table1:

select aaa, bbb, ccc from xxx where zzzz;

Qlikview simply passes the sql statement to the database and the database executes the statement and gives qlikview back the results.


talk is cheap, supply exceeds demand
Not applicable
Author

hi Gysbert,

the thing is am trying to move away from using the sql because i am trying to use qvds which i have generated and so i am trying to do the selections within the load statements of qlikview unlike doing it from the database. am assuming it will improve performance. any comments or suggestions.

the qvds have being create by simple QVD generators loading entire tables

Gysbert_Wassenaar

I think this would do the same thing as your sql case statement.

if([MaxAccTransKey.MAXACCOUNTTRANSACTIONSET_KEY]= [ACCOUNTTRANSACTIONSET.ACCOUNTTRANSACTIONSET_KEY],

    if(len(trim([ACCOUNTTRANSACTIONSET.ATA_PAID_IND]))=0

        or [ACCOUNTTRANSACTIONSET.ATA_PAID_IND] = 'N'

        or [ACCOUNTTRANSACTIONSET.ATA_PAID_IND] = 'Y',

    1,0),

0) as Summary

Anyways, won't you still need to get 'fresh' data from the database? If you let the database do the stuff it's supposed to be good at, executing sql statements, then you can store the results in qvd's already processed the way you want it. You then won't have to process the data in qlikview anymore, so you win performance there.


talk is cheap, supply exceeds demand
Not applicable
Author

Hi,

I was thinking in those as well though i have a bit of a fix u store one table per QVD so how can i process the data in the database from defferent tables and then load in a QVD??  thanks for all the help