Skip to main content
Woohoo! Qlik Community has won “Best in Class Community” in the 2024 Khoros Kudos awards!
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
QSense
Creator II
Creator II

cannot read from database

Hello everyone ,

I get data from oracle database but  a few columns' values are not show

when I put below formula in expression it doesnt get nothing

How Can I write in script side ?

I tried in load part  but it gives error I think because of sum formula.

sum(RPK_IN_COLL)/sum(ASK_IN_COLL)

5 Replies
renjithpl
Specialist
Specialist

you can use sum, 

LOAD Customer,

Sum(Sales), Count(Order) as NewField
RESIDENT MasterTable
GROUP BY Customer;


the syntax may be a little different in diff data source

QSense
Creator II
Creator II
Author

Hi,

I wrote a sample code I used group by İt gives same error ODBC read failed

load

"RPK_IN_COLL" ,

    "CYCLE_MARKET",

    "CYCLE_MARKET_LAST",

    'IR' as Flag,

    sum("RPK_LAST_DCS")/sum("ASK_LAST_DCS") as LF_LAST_1,

    sum("RPK_LAST")/sum("ASK_LAST") as LF_LAST,

    sum("RPK_IN_COLL")/sum("ASK_IN_COLL") as LF,

    ((("RPK_LAST_DCS")/("ASK_LAST_DCS"))-(("RPK_LAST")/("ASK_LAST"))+(("RPK_IN_COLL")/("ASK_IN_COLL")))*0.98 as EXPECTED_LF

Group by "RPK_LAST_DCS",

       "ASK_LAST_DCS",

       "RPK_LAST",

       "ASK_LAST",

       "RPK_IN_COLL",

       "ASK_IN_COLL"

;

SQL SELECT *

FROM "DWH_TEST"."OT_KAR_ILERI_REZ_BEK_LF_NEW_2"  where collection_time =  (SELECT max(collection_time)

FROM "DWH_TEST"."OT_KAR_ILERI_REZ_BEK_LF_NEW_2");

renjithpl
Specialist
Specialist

Try using a resident table

renjithpl
Specialist
Specialist

Table1:

SQL SELECT

     AIRPORT,
    BRANCH,
    COMPTYPE,
    COUNTRY
FROM ....;

Table2:

load

AIRPORT,

BRANCH,

count(COUNTRY) as CountCountry,

COMPTYPE,

COUNTRY

Resident Table1

Group by AIRPORT, BRANCH, COMPTYPE,COUNTRY;

drop table Table1;

QSense
Creator II
Creator II
Author

Thanks