I am working on generating quotation for customer for multiple equipment.
I have a parent table โCustomer Detailsโ and child table โQuotation Detailsโ.A customer can have multiple quotation details. Each row in Quotation details has columns such as [Part Code],[Equipment_Name],[List Price],[Qty] etc.
I am trying to generate a report for a customer with items from child table grouped by [Equipment_Name]. Something like this:
I read your post on Group By Reports and tried the same on my tables with changes. Your sample app works with one table and slice. Here, I am trying to generate report from parent table (Customer Details) and want to group the records by [Equipment_Name] from child table (Quotation Details). As suggested I have added the following VC to child table and slice:
VC [_RefEquipmentName]
INDEX((SELECT(Quotation Details[Row ID], [Equipment_Name]=[_THISROW].[Equipment_Name])),1)
VC[Related Equipment]
REF_ROWS(โQuotation Detailsโ, โ_RefEquipmentNameโ)
[SliceByEquipmentName]
IN([Row ID], SELECT(Quotation Details[Row ID], COUNT([Related Equipment])>0))
When I use the slice for outer loop, my entire table is repeated for as many times I have unique equipment name. Below is the image:
Could you help me out?
Thank you
Solved! Go to Solution.
This may help.
Could you please update what is the key column in Quotation Details Table?
The key column for Quotation Details is [Row ID].
Could you elaborate the below please? Is it repeating for all customers?
Replace your first <<Start>>
tag with:
<<Start: FILTER("Quotation Details", ([_ROWNUMBER] = MIN(SELECT(Quotation Details[_ROWNMUMBER], ([_THISROW-1].[Equipment_Name] = [Equipment_Name])))))>>
And your second <<Start>>
tag with:
<<Start: FILTER("Quotation Details", ([_THISROW-1].[Equipment_Name] = [Equipment_Name]))>>
Could you please clarify what does the [_THISROW-1] refer to?
@Steve Thank you for replying.
The parent table does not have [Equipment_Name] column. Hence, the first Start expression will throw an error.
Thank you for the clarification. I had read the article and completely misunderstood it.
I will attempt the Start expression again.
@Steve I am getting this error:
Failed: Action not performed because 2 errors are present. Error: Workflow rule โCreate draft quotation (pdf)โ action โAction 1โ Attachment template. Expression โFILTER(โQuotation Detailsโ, ([_RowNumber] = MIN(SELECT(Quotation Details[_RowNumber],([_THISROW].[Equipment_Name] = [Equipment_Name])))))โ is invalid due to: Error in expression โ[Row ID].[Equipment_Name]โ : Unable to find column โEquipment_Nameโ. Error: Workflow rule โCreate draft quotation (pdf)โ action โAction 1โ Attachment template. Start expression โFILTER(โQuotation Detailsโ, ([_RowNumber] = MIN(SELECT(Quotation Details[_RowNumber],([_THISROW].[Equipment_Name] = [Equipment_Name])))))โ should generate a List of Ref values. Please verify that it generates a List and that the contents of the List are Ref values. Ref values should come from the โKeyโ column of the referenced tableโฆ
Whoops! There should be a -1
in there, too:
<<Start: FILTER("Quotation Details", ([_ROWNUMBER] = MIN(SELECT(Quotation Details[_ROWNMUMBER], ([_THISROW-1].[Equipment_Name] = [Equipment_Name])))))>>
Iโve also updated the snippet in my original suggestion, too.
Got another error
Failed: Action not performed because 2 errors are present. Error: Workflow rule โCreate draft quotation (pdf)โ action โAction 1โ Attachment template. Expression โEndโ is invalid due to: Expression refers to undefined field. Error: Workflow rule โCreate draft quotation (pdf)โ action โAction 1โ Attachment template. Expression โStart: FILTER(โQuotation Detailsโ, ([_THISROW-1].[Equipment_Name] = [_THISROW].[Equipment_Name]))โ is invalid due to: Error in expression โ[Row ID].[Equipment_Name]โ : Unable to find column โEquipment_Nameโโฆ
Where do I place the End expression for Outer loop. This is current template:
Actually I think the first <<Start>>
tag goes inside the Part Code cell.
I am getting error messages stating that - cannot find column Equipment_Name.
When I run the same expression of the test editor, i get results but the workflow throws error.
Failed: Action not performed because 3 errors are present. Error: Workflow rule โCreate draft quotation (pdf)โ action โAction 1โ Attachment template. Expression โ[Equipment_Name]โ is invalid due to: Unable to find column โEquipment_Nameโ. Error: Workflow rule โCreate draft quotation (pdf)โ action โAction 1โ Attachment template. Expression โFILTER(โQuotation Detailsโ, ([_THISROW-1].[Equipment_Name] = [Equipment_Name]))โ is invalid due to: Error in expression โ[Row ID].[Equipment_Name]โ : Unable to find column โEquipment_Nameโ. Error: Workflow rule โCreate draft quotation (pdf)โ action โAction 1โ Attachment template. Start expression โFILTER(โQuotation Detailsโ, ([_THISROW-1].[Equipment_Name] = [Equipment_Name]))โ should generate a List of Ref values. Please verify that it generates a List and that the contents of the List are Ref values. Ref values should come from the โKeyโ column of the referenced tableโฆ
Lets try to narrow down which FILTER() expression is the problem. For testing, please replace the second <<Start>>
tag with:
<<Start: FILTER("Quotation Details", TRUE)>>
I replaced the second <> expression and got the following error message:
Failed: Action not performed because 1 errors are present. Error: Workflow rule โCreate draft quotation (pdf)โ action โAction 1โ Attachment template. Expression โ[Equipment_Name]โ is invalid due to: Unable to find column โEquipment_Nameโโฆ
For the below, did you refer to Part Code header cell or Part Code value cell?
Please provide a screenshot of the entire column list of the Quotation Details table.
Column list:
[Row ID] is the key column. [Qtn_No] references Customer Details table.
Hi Steve,
Following your example I was able to group the data... but I would also like to filter by period ([Start_Date] and [End_Date]).
Is this possible? And what would the expression be?
Thanks in advance for your help!
This may help.
A nice, compact solution @Marc_Dillon.
@Nirmal_Giri: I believe @Marc_Dillonโs solution is much easier to implement. You may wish to explore that instead of the approach mentioned in my sample app.
I got the report working.
Thank you for help. @Suvrutt_Gurjar @Steve
Hi @Nirmal_Giri,
Thanks for the update. Great to know that you got it working with @Steveโs guidance. Frankly I did not add any contribution in your query in this entire post thread.
I may however request you to share your final working template if possible so that anyone having a similar requirement in future can utilize that. Of course, please hide senstive field names, data values etc. as you have already done in previously shared images.
I realized too late on the data values and field namesโฆ Thank you for reminding.
I will share the final template and how it looks like, and edit the earlier images too.
Had to delete the previous posts due the security reasons.
Reposting the final working report template on how to group data in reports. Thank you @Marc_Dillon
Image on left is the template and that on right is the output.
Hi,
Iโve been reading this thread for a few days now and got my table to group correctly but the way it is setup results to the columns not being aligned. If I put the start and end tags in the table it produces an error where it cant read the column names i put in the cells.
would appreciate any help on thisโฆ
Thanks!
Please post screenshots of both the error and your template.
hi Steve,
This is the section of the template I am working on:
here is the error I get:
Is the template you posted the one where the START is inside of the table, and returns that error? What does the other template look like, and what does the outputted file look like?
Hi Marc,
Yes, the one I posted is when the START is inside the tableโฆ
If I use the template where the start is outside the table, it looks like this:
Yep, looks familiar. I donโt believe there is any way to get the columns from table to table to line up exactly, but play around with manually setting a value for each columnโs width. Iโve also gotten around it before by getting rid of the cell borders so the โjitterโ is not so obvious.
Hi @Marc_Dillon,
I would assume that the column width there applies to all columns currently on the table?
It is unfortunate to know that it does not align correctlyโฆ but appreciate all the help! Thanks
You should specify a column width for EACH column, by right clicking from any cell in that column.
Hi @Marc_Dillon will try that! Thanks for your help
User | Count |
---|---|
17 | |
14 | |
8 | |
7 | |
4 |