You can create an additional field in the script (or a calculated dimension) to classify your records into these two groups:
if(match(DataTypes,'red','green','blue'), 'Colors', 'Length') as DataClasses,
Then use DataClasses as dimensions in your chart and something like
as expression. Use 'relative' option to display percentages.
Hope this helps,
You should use the LOAD in your script. If you run my sample code, you should get a new field DataClasses with two values, Colors and Length, which classify your DataTypes values.
Not sure if this is what you want, so maybe you want to elaborate a bit more about your data and the report you need (e.g. by posting a bit more complete table, I assume you've got more than one field to consider here?).
Ok, I will try to explain again.
I am loading data from a Excel Spreadsheet. The relevant coulmns are as follows:
Ordtime Lønnsart 1 Arbeidstimer 2 Arbeidstimer 5 Overtid 50% 4 Overtid 50% 8 Sykemleding 10 Overtid 100% 13 Ferie 4 Ferie 8 Egenmelding 8 Sykt barn
I want to group data based on Column 'Lønnsart' the following way:
'Arbeidstimer', 'Overtid 50%' and 'Overtid 100%' into group 'Produksjon'
'Sykemelding', 'Egenmelding' and 'Sykt barn' into group 'Fravær'
Then I want to make a pie chart which sums the 'Ordtime' of the respective groups
So I figure the Expression should be 'Sum(Ordtime)'
But I am not able to get the Dimension right..
Ok, same procedure as mentioned above, you can classify your data using a new field created with a match condition:
if(match(Lønnsart,'Arbeidstimer','Overtid 50%','Overtid 100%'),'Produksjon',
if(match(Lønnsart,'Sykemleding','Egenmelding','Sykt barn'),'Fravær')) as ClassInline
5, Overtid 50%
4, Overtid 50%
10, Overtid 100%
8, Sykt barn
or create a new INLINE table that links to your Lonnsart:
LOAD * INLINE [
Overtid 50%, Produksjon
Overtid 100%, Produksjon
Use your Class.. field as dimension and sum(Ordtime) as expression. Check attached sample.
comm70246.qvw 143.2 K