Skip to main content
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: 
MeeraAgrawal
Creator
Creator

Qlik sense script error

Hi Guys 

I have table like this. I want to make line chart based on category and SCNR_ID will be the filter. I have load data using script.

scenario_waterfall:
LOAD
SCNR_ID,
CATEGORY,
COST,
FROM [lib://DataFiles/scenario_waterfall.csv]
(txt, codepage is 28591, embedded labels, delimiter is ',', msq);

Sum_of_cost:
Load CATEGORY, Sum(COST) as Node_cost Resident scenario_waterfall Group By CATEGORY;

SCNR_IDCATEGORYCOST
BSLINECDC-DESTINATION35455202.76
BSLINERDC-CDC2452100.513
OPTCDC-DESTINATION5096324.264
OPTRDC-CDC2866304.793

 

But its giving me total cost instead of category wise cost. why it's happening I want to do this by using script only.

 

3 Replies
AbhijitBansode
Specialist
Specialist

Can you share Excel source file that you are using

agigliotti
Partner - Champion
Partner - Champion

maybe this:

Sum_of_cost:

Load SCNR_ID, CATEGORY, Sum(COST) as Node_cost Resident scenario_waterfall Group By SCNR_ID, CATEGORY;

I hope it can helps.

Saravanan_Desingh

I think once you are done with Aggregation, drop the Fact Table.

scenario_waterfall:
LOAD * INLINE [
    SCNR_ID, CATEGORY, COST
    BSLINE, CDC-DESTINATION, 35455202.76
    BSLINE, RDC-CDC, 2452100.513
    OPT, CDC-DESTINATION, 5096324.264
    OPT, RDC-CDC, 2866304.793
];

Sum_of_cost:
Load CATEGORY, Sum(COST) as Node_cost Resident scenario_waterfall Group By CATEGORY;

Drop Table scenario_waterfall;

commQV47.PNG