Qlik Community

QlikView App Development

Discussion Board for collaboration related to QlikView App Development.

Announcements
Modernize Your QlikView Deployment webinar, Nov. 3rd. REGISTER
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Creator II
Creator II

Grouping SAles

Hi everyone,

I have a table with the Custaccount and number of sales, with the following Script. I would like to group the sales like

number of sales  Clasification

0-1                    A

6-10                  B

11-15               C

OLEDB CONNECT TO $(QsgConAX);

[SALES_COUNTER]:

LOAD

   

     CUSTACCOUNT,

                    count( distinct [SALESID] ) AS SALES_COUNTER WHERE WildMatch([SALESID], 'PV00*')

GROUP BY CUSTACCOUNT ;

SQL Select AX_SQL_SALESTABLE_2012.SALESID, AX_SQL_SALESTABLE_2012.CUSTACCOUNT From AX_SQL_SALESTABLE_2012;

Thank's!!!

Eduard

1 Solution

Accepted Solutions
Highlighted

You should be able to add code (after what you already have) such as:

LEFT JOIN (SALES_COUNTER)

LOAD DISTINCT

     SALES_COUNTER

     if(SALES_COUNTER >= 0 and SALES_COUNTER <= 1, 'A',

     if(SALES_COUNTER >= 6 and SALES_COUNTER <= 10, 'B',

     if(SALES_COUNTER >= 11 and SALES_COUNTER <= 15, 'C'))) as Classification

RESIDENT SALES_COUNTER;

View solution in original post

3 Replies
Highlighted

You should be able to add code (after what you already have) such as:

LEFT JOIN (SALES_COUNTER)

LOAD DISTINCT

     SALES_COUNTER

     if(SALES_COUNTER >= 0 and SALES_COUNTER <= 1, 'A',

     if(SALES_COUNTER >= 6 and SALES_COUNTER <= 10, 'B',

     if(SALES_COUNTER >= 11 and SALES_COUNTER <= 15, 'C'))) as Classification

RESIDENT SALES_COUNTER;

View solution in original post

Highlighted
Not applicable

Hi

you can use the CLASS function which does it for you

best regards

chris

Highlighted
Creator II
Creator II

Thank's!!!! great!!!