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

Announcements
Want to see what's currently in public preview? We've pulled it all together in one place. Check it out here
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.

 

Labels (4)
3 Replies
AbhijitBansode
Specialist
Specialist

Can you share Excel source file that you are using

agigliotti
MVP
MVP

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.

The Power of shining a light on the dark side of your data.
Follow me on my LinkedIn | Know Gamma Informatica at gammainformatica.it
Saravanan_Desingh
MVP
MVP

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