Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi Friends,
I've an issue in calculating the turn for two fields.
Lets say I have a field Date1, Date2 where the turn should be calucated for Date1 and Date2
Sample Data
Order No | Iteration | Start | End | Turn |
---|---|---|---|---|
123 | Iteration1 | 23/06/2015 15:42:46 | 24/06/2015 09:11:33 | =networkdays(23/06/2015,24/06/2015) =2 |
123 | Iteration 2 | 24/06/2015 09:18:23 | 24/06/2015 18:29:17 | --Turn 2 =1 |
123 | Iteratin 3 | 26/06/2015 11:28:08 | 26/06/2015 14:08:18 | --Turn 3 =1 |
123 | Iteration 4 | 26/06/2015 14:36:12 | 26/06/2015 16:35:54 | --Turn 4 =1 |
Average | =Average(2,1,1,1)=1.25 |
But the Start Date and End Date comes from different tables based on Primary Key and iteration is what I added for better understanding of my requirement.
Now i want to calculate the turn at every iteration based on the Order No.
If I try to join these two fields with the Order No, it is doing cross join and populating 16 combinations and the turn metric is being calculated wrongly.
Wanted help on how to deal with such scenarios.
Final I want to see turn as 1.25 for the Order 123
Thanks,
Sindhu
Hi Sindhu, the document attached returns the expected result but it has a very weak logic.
The first StartDate of an order is related to the first EndDate of that order, same for the 2nd, 3rd... For this sample of data is ok, but in real data I think you can find some issues.
Please post a qlikview document that demonstrates the problem.
Hi,
Here I attached the sample source data and QV app.
Can anyone help me out in this...
Create a straight table, not a text box, and enter an expression along the lines as the ones above, Sum(End - Start)
Hi Michael,
Thanks for your reply.
But that is not working, however I need the turn for every iteration it travels that phases.
--Sindhu.
Try something like this: Sum({1<[OrderNumber]=>} [End-Start]))
What you want is not possible. There is not enough information to determine which startdate belongs to which enddate.
Exactly, when I load it it is doing n*n mappping.
But the right combinations are the ones which I posted in the Sample data.
I want to align it in this way and find the turn for it.
So I wanted some logic in making this work and avoid cross joins.
It is not possible. You need to come up with some sort of a unique key between the two tables other wise you end up having a cross join