Qlik Community

New to QlikView

Discussion board where members can get started with QlikView.

Announcements
QlikView Fans! We’d love to hear from you.
Share your QlikView feedback with the product team… Click here to participate in our 5-minute survey.
Rules, plus terms and conditions, can be found here.
Not applicable

Newbie question about group by()

Hello community

I'm sort of new in development.

The thing is should I insert some calculation function in all field except grouping field? Like max(field1), maxstring(field2), max(field3) from .... group by field4, field5.

Is there any other better solution of group data?

Regard Muncho

7 Replies
yasus
New Contributor III

Newbie question about group by()

Hi Muncho,

you could try a distinct load...

Not applicable

Newbie question about group by()

Hello Gregor,

Distinct load doesn't fit my case.

But thanks

erich_shiino
Honored Contributor

Newbie question about group by()

Hi, Muncho

Not sure if I understood your question...

You can make as you thought:

load max(field1), maxstring(field2), max(field3), field4, field5

from .... group by field4, field5;

As you would do on a sql database...

You you give us more details or a sample we can provide a more detailed answer.

Hope it helps,

Erich

Not applicable

Re: Newbie question about group by()

Let's say i have below fields

userID, last_name, first_name, age, gender, address1, address2, address3, phone, country, postal_code...

Ok, now i need to group them by userID using group by clause. So i need to use max() or count() in every field right?

I just want to know is there better way to do this.

BTW sorry for my bad English.

Not applicable

Re: Newbie question about group by()

Yes, i know i need to tell QV which field to use in grouping.

But i know there is better way which i don't know.

Please open my eyes little bit

erich_shiino
Honored Contributor

Re: Newbie question about group by()

You have to do it if you want to group data but maybe you can create different rules, for example, keep only the last record for one userID, only the first, etc

In those cases, I would create a table with flags depending on the condition, apply those flags back in the main table using left join and then use resident load to keep only the values that matched the flag.

I'm not sure if you can apply it on your model.

Not applicable

Re: Newbie question about group by()

Thanks Gregor and Erich.

I got something on your posts.

Community Browser