i have this code <https://trycf.com/gist/b0653a4a3...
# cfml-general
g
i have this code https://trycf.com/gist/b0653a4a3fb93bb72e1c52ef23ff6303/lucee5?theme=monokai its working but the problem with this code, i aam splitting the dates according to days like 1 to 7, and every record is coming in a new row, duplicating the project name and task desc, whiclle i wanted that values which are from Mon to fri for that one row if they have should come in the same row, i am friend up with but unable to figure what i am doing wrong here, i tried grouping but that did not solved the issue, it just does not show some records then
m
This code doesn't run in trycf as-is...
you will be able to see the data now, and if need i can explain, how i want the data to appear , in the case sweekday i had set to saturday, it could be friday or sunday
m
I'm not quite understanding; how exactly do you want to group the records? Can you create a mockup of your expected results?
even just a drawing of expected results
g
sure i will like this
m
Seems like you'd want to run a query with aggregate functions/group by, but I don't know if QoQ supports that. If Not, I'd skip the query, throw it in a struct, perhaps using the project name & task names as keys, since those seem to be your grouping columns.
g
any sample u can share
m
Not at the moment.
Make a struct. Loop through your query. If no key exists for project name + task Name, create one with a struct. Initialize it with the days of the week and 0 sums. Then load that struct with the data from the query record, adding to the sums as needed.
g
Ok I had tried by it seems it’s skipping some rows which I need it really I can share that so we can take another look to see how we can fix it
m
did you update your trycfm?
g
Not with struct thing but I will do in few mins
this is i came up with it should behave this like read the structre and nested structes and will create one row or two rows depending upon the second structure has a different value, and in the case of third structre which is reg and adj, it has same keys inside them, so it will merge them and adjust the values in the keys, if the reg and adj has different values like negative and then reg has a different values, in that case it will create two separate rows showing both records, always make sure the data is correct Here is the image how it is looking as of now https://prnt.sc/vCxX2EEYlGnp
@Adam Cameron I need your guidance here This section literally fried me up
a
Why did you duplicate everything here that you asked on Stack Overflow already? (ref for others: https://stackoverflow.com/questions/78110672/the-rows-are-reapeating-over-and-over-for-a-query)?
I'll try to look at it tomorrow but all the upper-case tag-based code in the stack overflow Q was too much for me to look at.
Also, are you the same person who sometimes posts here as SmithJones / @Simone? (going on the very similar handle on Stack Overflow, and - in general - the same quality of questions comms style)
g
That is my junior
Working for me He is also stuck on same issue I gave him to fix it but he could not
I will Ask him to delete his question from stackoverflow as it can’t be double at two places