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: 
rkpatelqlikview
Creator III
Creator III

How to divide a groups based on the records

Hi,

Can anyone please help to write the backend code for this scenario?

I have table which is having the stores and sales. I need to divide three groups.

Group1 is 0-100 sales, Group2 is 100-300 sales, above 300 sales - Group3.

How many vehicles having for each group.

I need to show group1 stores and groip2 and group3 stores in the list box and pie chart.

Thanks in advance.

27 Replies
rkpatelqlikview
Creator III
Creator III
Author

Many Thanks Youssef,

After writing the below script , Its showing below.

222.PNG

CurrentFleet:

mapping LOAD

//[Vehicle Number],

SubField([Vehicle Number],'(',-1) as [Vehicle Number],

    //[DEVICE NO],

    Date(STATUS) as STATUS

FROM

;

Load *,

if([Vehicle Number]<100,'Group1',if([Vehicle Number]>100 and [Vehicle Number]<300,'Group2','Group3')) as Group;

SND:

LOAD

Date(Date) AS Date,

    Plant,

    ApplyMap('CurrentFleet', [Vehicle Number],'N/A') as STATUS,

    [Carrier Code],

    [Carrier Name] AS [Transporter Name],

    [Vehicle Group],

    // [Vehicle Number],

    SubField([Vehicle Number],'(',-1) as [Vehicle Number],

    [LR Number],

(ooxml, embedded labels, table is Sheet1);

YoussefBelloum
Champion
Champion

My bad, try this:

SubField([Vehicle Number],'(',1) as [Vehicle Number]

rkpatelqlikview
Creator III
Creator III
Author

No Problem Youssef,

I tried with this. Getting like below

Capture1111.PNG

YoussefBelloum
Champion
Champion

Make sure you use the correct modified field,

you should have this:

Subfield.png

rkpatelqlikview
Creator III
Creator III
Author

Thanks Youssef,

Really am very sorry. Can you please check with this application?

Thanks

KUMAR

kumardeveloper19@gmail.com

YoussefBelloum
Champion
Champion

Done !

here is the result with =SubField([Vehicle Number],'(',1) on the right object

PS: I do it on the object, because i can't reload your app (don't have the data)

Subfield2.png

rkpatelqlikview
Creator III
Creator III
Author

Yes Youssef, Thanks its working in the frontend. When i written in the back end its not worked properly.

Many Thanks

YoussefBelloum
Champion
Champion