Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Sum from different criteria

I didn't manage to find a good subject name so let me explain in details :

0683p000009M5BR.png

I have those fields. As you can see there are client, service and time.

What i want is to get for each client :

- the time total  (sum of all time for the same client )

- time for each service

I managed to get the total time for each client with a tAggregateRow but now i can't figure out how to get the time for each service.

 

Example of what i want :

|Client  |TotalTime|Service1|Service2|Service3|

|ClientA|150          |45          |50           |55         |

|ClientB|99            |33          |33           |33         |

 

I don"t know how i can get all the service, place them in the colum name and get the sum of the time by client for every service.

 

If it's not clear enough, ask me.

Thank you in advance !

Labels (2)
1 Solution

Accepted Solutions
Anonymous
Not applicable
Author

Hi,

 

We have many ways to do your requirement but i did it as  follows.

 

0683p000009M5EZ.png0683p000009M5Ee.png

 

0683p000009M5Ej.png0683p000009M5Eo.png0683p000009M5Et.png0683p000009M5F8.png0683p000009M5FD.png

 

--

Please give Kudos and mark topics as solved where appropriate.

View solution in original post

7 Replies
Anonymous
Not applicable
Author

Hi,

 

Please provide 2 or more records of your input data and its corresponding output.

Anonymous
Not applicable
Author

Input data :

First col : Client;

Second : Service;

Third : Time.

0683p000009M5EU.png

As you can see, for one client there are different services and time corresponding.

 

So the output for the client RESAMANIA/STADLINE would look like :

|Client                            |TotalTime|IMPLEM-01|IMPLEM-03|

|Resamania/STADLINE|180           |60               |120              |

 

Tell me if you need more information.

Thank you anyway  hpamidipola !

 

Anonymous
Not applicable
Author

Hi,

 

We have many ways to do your requirement but i did it as  follows.

 

0683p000009M5EZ.png0683p000009M5Ee.png

 

0683p000009M5Ej.png0683p000009M5Eo.png0683p000009M5Et.png0683p000009M5F8.png0683p000009M5FD.png

 

--

Please give Kudos and mark topics as solved where appropriate.

Anonymous
Not applicable
Author

Hi hpamidipola,

 

Thanks for trying to help me !

Unfortunately, i can't find the components tHashOutput/Input on my talend version.

I checked on Talend Exchange also and i didn't find them neither. 

Do you have a link for me to DL it ? Else, is there another way to do it, maybe without that component. 

 

Thank you in advance 0683p000009MACn.png

Anonymous
Not applicable
Author

Hi,

 

1: On the main menu navigate to File –> Edit Project properties
2: Select Designer –> Palette Settings
3: Go to technical –> select tHashInput/tHashOutput and press the right arrow.

 

If you have more data please use file/DB components instead of hash components. The reason why i used the hash components is, i considered less data(only 3 records).

 

--

Please give Kudos and mark topics as solved where appropriate.

Anonymous
Not applicable
Author

I actually have more rows (5000-6000) . I receive that data from a tRest (post request). What can you advise me to use to do it ? 

Anonymous
Not applicable
Author

Hi,

 

You can use hash components.