Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Group by in qlikview and calculation on groupby

Hi All

What does group by does

Will it consider set of  rows as 1 row

I have a situation where

Employee id,  employee name, age, sur_name, country, orders

1                     bond                     26    james        usa         200 $

3                     bond                      26   james        canada   500$     

2                      lisa                       22     ray            russia     20$

2                       lisa                       22     ray            russia     40$

My question is if   Employee id,  employee name, age, sur_name, country,   is same expect orders

consider it as one id  and the total orders is sum of both the rows ie 60 $.

if  any value in  Employee id,  employee name, age, sur_name, country,   is different consider it as different record

the output in the above senario is

Employee id   total orders

1                     200$

2                      60$

3                      500$

can we achieve it by any aggr function or group by in the script

16 Replies
Not applicable
Author

Hi can you please tell me how did you got that,

i can see only noraml expressions and the output seems to be correct

Frank_Hartmann
Master II
Master II

i guess you need this:

aggr(count(EmpName),EmpID,surname,country,age,orders)

aarkay29
Specialist
Specialist

Capture.PNG

just try count(distinct(EmpID)

trdandamudi
Master II
Master II

Your requirement is very simple. Option I is very straight forward and all you need is one dimension and one expression, Option II is called Preceding Load and it works from bottom up. Meaning it will execute the second load first and then the first load. As I mentioned in order to use Group by you need to load the data first and then use the Group By on the resident table. If you still think you have a question, please let me know. Hope this helps....

Anil_Babu_Samineni

Still, You are facing issue

Is this You are Expecting

Capture.PNG

Then, You may try this

Simple take Dim as EmpID

Expression is -- Sum(orders)

Then Go to Number Tab and put like below

Capture.PNG

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
Anonymous
Not applicable
Author

Hi Cena,

I can't send qvw because of my personnel edition.

You can copy and paste dimensions and expressions as I have mentioned in my reply , it will work.

Thanks,

Not applicable
Author

Hi it worked for me thank u so much