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

Announcements
Join us in Bucharest on Sept 18th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
benvatvandata
Partner - Creator II
Partner - Creator II

How to add a grouped value field to the same field in script

Hi,

To better explain my question, I will use an example:

Table: Events

Field: ItemCode     ;     Values: A, B, C, D

Field: Expenses     ;     Values: 1, 2, 3, 4

I would like to add 'ALL' as an ItemCode and the sum of A,B,C,D expenses as it's Expenses value.

So my result would be:

Field: ItemCode     ;     Values: A, B, C, D, ALL

Field: Expenses     ;     Values: 1, 2, 3, 4, 10

What would the script look like for this?

Thanks,

Ben

15 Replies
benvatvandata
Partner - Creator II
Partner - Creator II
Author

take it easy... of course I appended it, I missed a quotation mark ha - but no expenses are shown?

Gysbert_Wassenaar
Partner - Champion III
Partner - Champion III

What field(s) are you using as dimension in your chart and what are the expressions you use?


talk is cheap, supply exceeds demand
benvatvandata
Partner - Creator II
Partner - Creator II
Author

Dim1: Division

Dim2: ReportItemCode

Exp:

sum({<MTGStatus = {'ASSIGNED','CLOSED','CLOSED BY FINANCE',

            'LOGISTICS CONFIRMED','PENDING/REP','PENDING/SPEAKER','PENDING/VENUE',

            'PROGRAM OCCURRED','RECONCILED', 'REQUESTED BY REP'},

            MTGDate = {">=$(=yearstart(today()))"}  >} Expenses)

Thanks,

Ben

Anil_Babu_Samineni

Your question is related to Script level. Have you seen Gysbert first reply

Or

This in bar chart?

Capture.PNG

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
Gysbert_Wassenaar
Partner - Champion III
Partner - Champion III

So, that same expression does return results if you use ItemCode as dimension, but not if you use ReportItemCode?


talk is cheap, supply exceeds demand
benvatvandata
Partner - Creator II
Partner - Creator II
Author

Phew, sorry it took me so long to respond - creating a new field eventually worked with my model. Thanks gysbert!

-Ben