Qlik Community

QlikView App Development

Discussion Board for collaboration related to QlikView App Development.

Highlighted
rkpatelqlikview
Contributor

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.

1 Solution

Accepted Solutions
YoussefBelloum
Esteemed Contributor

Re: How to divide a groups based on the records

Please find attached,

27 Replies
YoussefBelloum
Esteemed Contributor

Re: How to divide a groups based on the records

Hi,

there is a lot of methods to do it, here is one example:

Sales_table:

Load

.

.

if(sales>=0 and sales<=100,'Group1',  if(number>=100 and sales <=300,'Group2',  if(sales>300,'Group3'))) as Group

FROM

rkpatelqlikview
Contributor

Re: How to divide a groups based on the records

Thanks for your help. Can you please provide another scenario.

When am clicking on the transporter name. it should display that group name (1,2 or 3).

and there are Three list boxes Group1,Group2, Group3 It should the transporter names.

there are three Groups. The transporter is having the 0-100 fleets

that transporter will comes under the Group1, like this group2-100-300 fleets, above 300fleets- Group3

How many vehicles having for each group.

rkpatelqlikview
Contributor

Re: How to divide a groups based on the records

This one i have given in my front end. Like this can i write in the backend.

=IF(Count(DISTINCT  [Vehicle Number])<=100, 'Group1',

IF(Count(DISTINCT [Vehicle Number])>100 and Count(DISTINCT [Vehicle Number])<=300,'Group2',

IF(Count(DISTINCT [Vehicle Number])>300, 'Group3')))

YoussefBelloum
Esteemed Contributor

Re: How to divide a groups based on the records

Can you please attach sample data ?

rkpatelqlikview
Contributor

Re: How to divide a groups based on the records

Thanks for your help

Sample Data.  

TransNameFleets
ABC20
DEF102
GHI50
JKL202
MNO350
PQR400
STU450

ABC and GHI comes under Group1, DEF, JKL comes under Group2, MNO, PQR, STU comes under Group3.

Can i generate new fields for all these groups separately.

YoussefBelloum
Esteemed Contributor

Re: How to divide a groups based on the records

Please find attached

rkpatelqlikview
Contributor

Re: How to divide a groups based on the records

Many Thanks Youssef,

I need to show count of group1 transnames etc..

Group1  - 2

Group2- 2

Group3 - 3

YoussefBelloum
Esteemed Contributor

Re: How to divide a groups based on the records

Please find attached,

rkpatelqlikview
Contributor

Re: How to divide a groups based on the records

Thank you so much Youssef.

Community Browser