Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

group by model name

Hi All ,

I  have a  column calle model type whichis as follows :

   MODEL TYPE:

    hp pavillion

    hP brav

   hp g series

  dell geo

  dell alpha

dell matrix

sony light

sony smart

                                          I want to know how to write a query for this so that i can have only model like hp, sony and dell in pie chart

Can some one help me plz

Thanks In Advance

7 Replies
qlikoqlik
Creator
Creator

Hi

You can use subfield function in the script.  This gives you the substring using the delimiter

I am thinking space is the delimiter and position of the delimiter is 1.

SUBFIELD([MODEL TYPE],' ',1) as mODEL

Substring.GIF.gif

Regards

Padma

Anonymous
Not applicable
Author

Does the attached give you food for thought ?

Left hand pie chart was sorted in the script and right hand one in the GUI.

qlikoqlik
Creator
Creator

HI Bill

I lost you, where is the pie chart that you are referring to

Thanks

Padma

its_anandrjs

Add calculated dimension in the Pie chart as

If(  Lower( Match( Subfield( [MODEL TYPE],' ',1),'hp','dell','Sony') , [MODEL TYPE] )


Note:- And select Suppress when value null option.

Anonymous
Not applicable
Author

Open the qvw I attached and you will see the pie charts

qlikoqlik
Creator
Creator

Oh! Thanks

I will check when I get work as I have only personalised edition at home

Regards

Padma

Anonymous
Not applicable
Author

In the script :

Temp :

LOAD * INLINE [

  MODEL, TYPE, METRIC

  hp, pavilion, 1

  hP, brav, 2

  hp, g series, 3

  dell, geo, 4

  dell, alpha, 5

  dell, matrix, 6

  sony, light, 7

  sony, smart, 8

];

DataTable:

load

  MODEL ,

  lower(MODEL) as Model ,

  TYPE ,

  METRIC

resident Temp

;

drop table Temp

In the GUI :

Calculated dimension          =lower(MODEL)