i run around in my data and had another idea for something i can display.
What about a KPI showing the timerange in days an article was in store from delivery to the store till it was
So we have articlenumber, amount,sold/delivery, date.
The thing is that there can be 2 deliveries of a product before even one sales.
But with diffdate i only get the datedifferenc to the last deliverie of the same product.
So maybe create a var with the amount coming in from delivery and use this as the delivery date for the diffdate expression as long its not 0.And when its 0 switch to the next delivery date, so we allways have the right date.
And an if,if there is no delivery date before the sold-date i want to take the start date of the timerange.
The problem here, again i have a great idea but no clue about how i can achiev this in the right way.
So maybe u can give me some tipps.
Thanks for help in advance
thanks for ur answer. make sense i just need to test if its possible wit my field with sold and delivery and the start date because I let the user pick daterange via daterange picker.
So I think firstly i will let the start date of Timerange out of my calculation,and when there is no delivery date i dont take it into consideraion.
once again i tried a few things but dont get it to work .
where a bit of code of my loadscript to calc the diffdate:
load articlenumber,Date_VD as delivery_date
where "sold/delivery" ='delivery';
load articlenumber,Date_VD as sold_date
where "sold/delivery" ='sold';
sold_date - delivery_date as diffdate resident temp;
If you have multiple delivery dates and you only want to use the earliest one then try this:
load articlenumber, min(Date_VD) as delivery_date
where "sold/delivery" ='delivery'
group by articlenumber;
thx for that tipp and there is the point where my trouble begins with the delivery date.
Because of mutliple delivery dates i must implement some sort of var that count down the amount from delivery down and then when the amount hits zero switch do the second earliest.
hope i explain it decent enough.
thx for this link,
searched around a bit, and now i think i do it bit different.
i think its better to find out the delivery date first and add it as a column so i dont have the problem with the search for delivery date and calc at the same time.
Hope u can help me with the find earliest delivery date, and add a counter(var) and switch to the next on if zero.
thanks in advance