Forum Discussion
Mars3442
2 years agoHelper I
Replace value that between 2 date
Hi everyone, I want to ask for help solving my problem I have a note of available products like this The availability of the product can be created new date or can be extended My raw dat...
Mars3442
2 years agoHelper I
Thank you for your help
But can you explain this part?
//Group by Product
//then create a list of all available dates for each product
#"Grouped Rows" = Table.Group(Availability, {"Product Name"}, {
{"Available", (t)=>
List.Combine(
List.Generate(
()=>[d=List.Dates(
t[Start Date]{0},
Duration.Days(t[End Date]{0} - t[Start Date]{0})+1,
#duration(1,0,0,0)),
idx = 0],
each [idx] < Table.RowCount(t),
each [d=List.Dates(
t[Start Date]{[idx]+1},
Duration.Days(t[End Date]{[idx]+1} - t[Start Date]{[idx]+1})+1,
#duration(1,0,0,0)),
idx = [idx]+1],
each [d]
))
}}), ronrosenfeld
2 years agoFrequent Visitor
What about that code do you not understand? Examine the applied step. You will see it creates a List of available dates for each product. Later on we will use that List to determine if the order occurs at a time when that product is available