Skip to main content

New to Qlik Sense

If you’re new to Qlik Sense, start with this Discussion Board and get up-to-speed quickly.

Announcements
Skip the ticket, Chat with Qlik Support instead for instant assistance.
cancel
Showing results for 
Search instead for 
Did you mean: 
Vasujoshi_700
Partner - Contributor III
Partner - Contributor III

Chart Level Scripting Use Case

Hi everyone,

Can Anyone provide me with the use case of char level scripting, i am not getting the idea how can i put chart level scripting in use, any suggestion, example or use case is welcome.

Labels (3)
5 Replies
rwunderlich

Here is a use case I've come up with. Adding a Total bar to a bar chart. 

rwunderlich_0-1661442229045.png

You would think this could be done with the chart script:

Add Load
'Total' as Division,
sum(Sales) as Sales
Resident HC1;

But that script actually replaces the first row, not what I expect. I'm unsure if that is a bug or a misunderstanding on my part. 

rwunderlich_1-1661442524640.png

As a workaround, I can make it work with this script (this is how the first picture was generated)

Let vTotal = 0;
Let P = HCNoRows();
For J = 1 to P
  Let vTotal = vTotal + HCValue(Sales,J);
Next
Add Load 'Total' as Division, $(vTotal) as Sales Autogenerate 1;

-Rob
http://www.easyqlik.com
http://masterssummit.com
http://qlikviewcookbook.com

 

Vasujoshi_700
Partner - Contributor III
Partner - Contributor III
Author

Thanks sir,

so it means we can add new measures in particular char with the chart level scripting.

rwunderlich

Yes, I believe you can add new Measure columns. The documentation and examples are still rather scant. 

-Rob

devan9876
Creator
Creator

I don't have access to that version yet, but if I understand this feature properly I suspect it could be used for creating custom row subtotals like in a p&l statement which previously required some combination of extensions and/or making changes to the data model to load in dummy fields.

Or
MVP
MVP

Hi Rob, since you seem to have gotten this working a lot better than I have so far - have you had any luck adding data from a secondary source (not autogenerate/inline)? Documentation suggests we can use a following SQL statement, which would be brilliant as it would allow for real-time object updates from a database source, except I think that's just copy-pasted from the "regular" Load statement help page. I have not had any luck adding information from an SQL source or even from a resident table, though this might be an issue on my end given the lack of documentation and guesswork involved in getting the syntax right...