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

Returning value based on a condition from multiple records in a table chart

Here is situation I need to resolve.

I have a table with records (transactional records), some records have quantity which is negative (because someone sold something) and some have positive value (because someone bought something). They always come in pairs, I have one transaction ID which will have two rows in my table.

Now, I am trying to make table where I will be able to easily see direction of sales (who is selling to whom), so if my database look like this:

TransactionIDValueCustomerID
110100
1-10105
2-14107
214105
399122
3-99100

my resulting table chart should look like this:

TransactionIDSourceTarget
1105100
2107105
3100122

My table dimension is TransactionID and my expressions are Source and Target, and in this collumns I have to return CustomerID, if the collumn is Source, I have to return CustomerID from the database rows with my TransactionID where Value is negative, and Target should be CustomerID where Value is positive.

Any idea on how to do it? (I guess it is something simple and obvious, but my brain just halted and refuse to cooperate)

1 Solution

Accepted Solutions
jaumecf23
Creator III
Creator III

Hi,

Attached you can find a possible solution.

View solution in original post

2 Replies
jaumecf23
Creator III
Creator III

Hi,

Attached you can find a possible solution.

marko_rakar
Creator
Creator
Author

yes, quite obvious

thanks