Skip to main content
Announcements
See what Drew Clarke has to say about the Qlik Talend Cloud launch! READ THE BLOG
cancel
Showing results for 
Search instead for 
Did you mean: 
rassanbekov
Partner - Contributor
Partner - Contributor

How to allocate value in other fields

Hello! 

Please help to create a graph to show in dimension "Group" where Group = "E"  "Amount" (expression sum) allocated among other groups which group the code belongs.

I have the following data model:

LOAD * INLINE [

    EmplID, Group, Amount, Code

    1, A, 100, 123

    2, B, 200, 234

    3, C, 300, 345

    4, A, 400, 456

    5, B, 500, 123

    6, E, 600, 234

    6, E, 700, 123

];


LOAD * INLINE [

    Manager, Code, Group

    Manager 1, 123, A

    Manager 2, 234, B

    Manager 3, 456, A

    Manager 4, 345, C

];

6 Replies
prma7799
Master III
Master III

Expected output?

rassanbekov
Partner - Contributor
Partner - Contributor
Author

Graph can be a straight table with dimension "Group" and expression "=sum(Amount)". But I need to allocate amount for group "E" among other groups. How can I do??

prma7799
Master III
Master III

Like this??

Dimension  : Group

Expression : Sum({<Group = {'E'}>} Amount)

gerry_hdm
Creator II
Creator II

How should the values be distributed?
123 of E is in A and B is to be distributed 50 50 or proportionally
234 of E is only available in B

in your INLINE model are synthetic key

Greeting Gerold

rassanbekov
Partner - Contributor
Partner - Contributor
Author

No, please carefully read question

rassanbekov
Partner - Contributor
Partner - Contributor
Author

The distribution should be 100% for A and 100% for B, but when script read group "E"  it should refer to second table and take value from Code -> Group.

To avoid synthetic key, you can rename field "Group" to "Group_2".