cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
AVTS
Helper V
Helper V

Virtual Incremental Column no - Canvas Ap

Team,

I have the formula with groupby concept. In this i would like to add virtual incremental number instea of from table,

 

Below is my codings,

 

Test1.Run(User().Email,
JSON(With( {TheTable:
Filter(ShowColumns(Dailyinventory,"crf99_sno","crf99_materialdesc","crf99_materialno","createdon","crf99_bbd","crf99_qty"),DateDiff(createdon, Today(),Days) =0)},
ShowColumns(AddColumns(GroupBy(TheTable,"crf99_materialdesc","NewGroup"),
"Materialno",First(NewGroup).crf99_materialno,
"Qty",Sum(NewGroup,crf99_qty),

"Created On",Last(NewGroup).createdon,
"bbd",Last(NewGroup).crf99_bbd,
"Sap-Stock",LookUp(sapstock,material=First(NewGroup).crf99_materialno ,unrestrictedStock)),

"Created On","bbd","crf99_materialdesc","Materialno","Qty","Sap-Stock"))))

 

Below is my current result,

 

AVTS_0-1622892366968.png

 

Exepect result, Show virtual column  in first row "Sno"

 

AVTS_1-1622892425384.png

 

1 ACCEPTED SOLUTION

Accepted Solutions
CNT
Community Champion
Community Champion

@AVTS Try this,

 

Test1.Run(User().Email, 
  JSON(With(
      {TheTable: 
	    ShowColumns(
			AddColumns(
			  GroupBy(
				Filter(
					ShowColumns(
					  Dailyinventory, "crf99_sno", "crf99_materialdesc", 
					  "crf99_materialno", "createdon", 
					  "crf99_bbd", "crf99_qty"
					), 
					DateDiff(createdon,Today(),Days) = 0
				), "crf99_materialdesc", "NewGroup"
			  ), 
			  "Materialno", 
			  First(NewGroup).crf99_materialno, 
			  "Qty", 
			  Sum(NewGroup, crf99_qty), 
			  "Created On", 
			  Last(NewGroup).createdon, 
			  "bbd", 
			  Last(NewGroup).crf99_bbd, 
			  "Sap-Stock", 
			  LookUp(
				sapstock, 
				material = First(NewGroup).crf99_materialno, 
				unrestrictedStock
			  )
			), 
			"Created On", 
			"bbd", 
			"crf99_materialdesc", 
			"Materialno", 
			"Qty", 
			"Sap-Stock"
		)
	  },
	  ForAll(Sequence(CountRows(TheTable)), 
		Patch(Last(FirstN(TheTable, Value)),{Sno : Value}))
    )
  )
)

View solution in original post

4 REPLIES 4
CNT
Community Champion
Community Champion

@AVTS Try this,

 

Test1.Run(User().Email, 
  JSON(With(
      {TheTable: 
	    ShowColumns(
			AddColumns(
			  GroupBy(
				Filter(
					ShowColumns(
					  Dailyinventory, "crf99_sno", "crf99_materialdesc", 
					  "crf99_materialno", "createdon", 
					  "crf99_bbd", "crf99_qty"
					), 
					DateDiff(createdon,Today(),Days) = 0
				), "crf99_materialdesc", "NewGroup"
			  ), 
			  "Materialno", 
			  First(NewGroup).crf99_materialno, 
			  "Qty", 
			  Sum(NewGroup, crf99_qty), 
			  "Created On", 
			  Last(NewGroup).createdon, 
			  "bbd", 
			  Last(NewGroup).crf99_bbd, 
			  "Sap-Stock", 
			  LookUp(
				sapstock, 
				material = First(NewGroup).crf99_materialno, 
				unrestrictedStock
			  )
			), 
			"Created On", 
			"bbd", 
			"crf99_materialdesc", 
			"Materialno", 
			"Qty", 
			"Sap-Stock"
		)
	  },
	  ForAll(Sequence(CountRows(TheTable)), 
		Patch(Last(FirstN(TheTable, Value)),{Sno : Value}))
    )
  )
)

View solution in original post

CNT
Community Champion
Community Champion

@AVTS Hope the solution worked!

 

Please remember to give a 👍 and accept the solution as it will help others in the future.

AVTS
Helper V
Helper V

Yes . It worked. Thank you .

CNT
Community Champion
Community Champion

@AVTS Glad to help!

 

Please remember to give a 👍 and accept the solution as it will help others in the future.

Helpful resources

Announcements
PA_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

Power Query PA Forum 768x460.png

Check it out!

Did you know that you can visit the Power Query Forum in Power BI and now Power Apps

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

R2 (Green) 768 x 460px.png

Microsoft Dynamics 365 & Power Platform User Professionals

DynamicsCon is a FREE, 4 half-day virtual learning experience for 11,000+ Microsoft Business Application users and professionals.

Users online (1,231)