Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
I've encountered a problem I can not solve and need some help!
I have the dimensions "From Destination" and "To Destination". I use this to calculate the number of tons between differents locations, with the expression sum(tons). But, I need to turn this expression to how many tons who are sent back along the same line in return.
In other words, I must fetch up the "To Destination" and make it calculate this as an "From Destination". I tried to use SET expression like Sum({$<[From Destination] = {[To Destination]}>} Tons), but it returns only zero...
Is there anyone who can help with some suggestions here?
///Tom
Hi Tom,
Finally !! so glad to do this.
Kindly find the attached app.
Final result is exactly what you want.
Hope this is correct and helpful! ![]()
Thanks and Regards,
Ankita
Hi Tom,
Qlikview doesn't allow to column names to be same.
So you need to change the 2nd From and To Destination to From Destination 1 and To Destination 1 and Tons to be Tons Returned.
That way it will be easy for you to write an expression.
Because I suppose you need extra column for Return from London to Oslo as shown in your image
Hi Tom,
can you post your qvw?
Regards
Andy
Hi Andrew,
This is just a test file since the original is too big and not allowed to publish (company rule).
Hope this helps describing my problem...
///Tom
Hi Tom,
You can store the From Destination value in vTo variable (Oslo) and ToDestination value in vFrom variable (London).
and in the expression you can write
=sum({<[From Destination]={'$(vTo)'},[To Destination]={'$(vFrom)'}>}Tons)
Do you have just 1 from and To location or you have many?
Hi Ankita,
No, I have over 300....
///Tom
Hi Tom,
Can you please look over the attached app..
I have made some changes in the script ![]()
Hi Ankita,
Thank you for responding and for the changes you did in the QV! This was good input and a new approach!
However, I want the returned tonnes in the same line as in the example picture that is attached.
Anyway, thanks responding! I really appreciate that!
///Tom
In your data table you have a separate row for the returns right?
Cant we bring them to the same row by creating extra columns?