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

Announcements
Join us to spark ideas for how to put the latest capabilities into action. Register here!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Hi Everyone please tell me where i'm doing wrong with this code

Hi Everyone

please tell me where i'm doing wrong with this code

tab1:

LOAD int_fk_dim_business_owner as  pk_dim_business_owner,

     int_fk_dim_channel,

     int_fk_dim_entity as pk_dim_entity ,

     int_fk_dim_geo as  pk_dim_geo ,

     int_fk_dim_industry as  pk_dim_industry,

     int_fk_dim_market,

     int_fk_dim_product,

     int_fk_dim_pov as  pk_dim_pov,

     int_fk_dim_period as pk_dim_period,

     int_fk_dim_uom as pk_dim_uom,

     int_fk_data_detail as pk_data_details,

     money_measure,

     int_fk_load_id,

     version_no,

     le_version_no,

     int_fk_dim_pov_2

FROM

E:\Satya\qvd\FACT_FINANCIALS.qvd

(qvd);

join

HierarchyBelongsTo( str_coa_code,str_partent_coa_code,node_name,ancestor_id,ancestor_name)

LOAD

     str_coa_code,

     str_partent_coa_code ,

     str_coa_description as node_name,

     pk_data_details

   

FROM

E:\Satya\qvd\DIM_DATA_DETAILS.qvd

(qvd);

LOAD

pk_data_details as PK_DATA_DETAILS,

ancestor_id as ANCESTOR_ID,

str_coa_code,

sum(money_measure)

Resident tab1

Where ancestor_id=' BS020030040010000000000000000000'

Group by pk_data_details,ancestor_id,str_coa_code;

8 Replies
sasikanth
Master
Master

hi Kumar what is the error u r getting while running this code ...

provide that one also it may simplify u r problem

Not applicable
Author

this is the error while loading script

"execution of script failed"

Not applicable
Author

Check your Group By, it should be Group By Money_measure.

Not applicable
Author

hello Kiran

Groupby function cant work on the field which is used for aggregation function like sum

stabben23
Partner - Master
Partner - Master

Hi,

you need to group by all field where you aggregate, like this:

LOAD

pk_data_details as PK_DATA_DETAILS,

ancestor_id as ANCESTOR_ID,

str_coa_code,

sum(money_measure) as money_measure

Resident tab1

Where ancestor_id=' BS020030040010000000000000000000'

Group by pk_data_details, ancestor_id, str_coa_code ;

Not applicable
Author

I did that but its not working,HierarchyBelongsTo function is giving some problem i think

Not applicable
Author

i changed my question,please review it

sasikanth
Master
Master

Hi..

Refer the document below once , which will give clarity  about HierarchyBelongsTo() function ...