Skip to main content
Announcements
Live today at 11 AM ET. Get your questions about Qlik Connect answered, or just listen in. SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
dickelsa
Creator
Creator

Splitting data into 3 groups

Hi guys,

So I have a problem I can't seem to think my way around:

i have a dataset of trucks with  certain profits, costs and margins.

To analyse these trucks, i will need to split them up into 3 groups:

- Best Trucks ( above  +10%  of average margin)

- Average Trucks (between +10% and -10% of average margin)

- Not so good Trucks. (below -10% of average margin)

now i want to create a field that when i click on 'average', the set with margin between +10% and -10% is filtered (on the same way as when you select a specific month in the dataset).

so I figured i would have to use avg(TOTAL Margin), but i don't know how to make a field using the statement..

it would be awesome if you can help me!

Best regards!

Dick

2 Replies
MK_QSL
MVP
MVP

You can find the avg margin in script itself using resident load

Create an avg at truck level with group by using another resident load

now join the 2nd to the first and create a flag ...

Kindly provide sample data to work..

dickelsa
Creator
Creator
Author

I tried it, but you cannot use the 'total'statement in the script.

see attached files in original message.

Note that 'Omzet' = Profit, 'Kosten'=Costs and 'BrutoMarge'= Margin