Forum Discussion
GerryL
4 years agoFrequent Visitor
List.Numbers Within a Range
Hello, I'm trying to generate a list of numbers in my dataset within a range from 10-50 in an increment of 10. In other words, as it generates the number for each row, when it gets to 50, it shou...
Vijay_A_Verma
4 years agoMost Valuable Professional
You can't replace () with anything else. Everything else is correct. It has to be
=List.Generate(()=>[x=10...........
GerryL
4 years agoFrequent Visitor
I got it to generate numbers, but not in the way that I need. Here's a sample of my data and what I am trying to do. This is already after much transformation to get to this point, and this is the last bit I need to create a reference table.
My data is currently set up like this:
| Merged Program Coding | Simplified Program Status | From | To | To Year | To Term | From Year | From Term | Years |
| MS_NSG:H502:HNUR:H522 | Active | 201250 | 202320 | 2023 | 20 | 2012 | 50 | 2012 |
| MS_NSG:H502:HNUR:H522 | Active | 201250 | 202320 | 2023 | 20 | 2012 | 50 | 2013 |
| MS_NSG:H502:HNUR:H522 | Active | 201250 | 202320 | 2023 | 20 | 2012 | 50 | 2014 |
| MS_NSG:H502:HNUR:H522 | Active | 201250 | 202320 | 2023 | 20 | 2012 | 50 | 2015 |
| MS_NSG:H502:HNUR:H522 | Active | 201250 | 202320 | 2023 | 20 | 2012 | 50 | 2016 |
| MS_NSG:H502:HNUR:H522 | Active | 201250 | 202320 | 2023 | 20 | 2012 | 50 | 2017 |
| MS_NSG:H502:HNUR:H522 | Active | 201250 | 202320 | 2023 | 20 | 2012 | 50 | 2018 |
| MS_NSG:H502:HNUR:H522 | Active | 201250 | 202320 | 2023 | 20 | 2012 | 50 | 2019 |
| MS_NSG:H502:HNUR:H522 | Active | 201250 | 202320 | 2023 | 20 | 2012 | 50 | 2020 |
| MS_NSG:H502:HNUR:H522 | Active | 201250 | 202320 | 2023 | 20 | 2012 | 50 | 2021 |
| MS_NSG:H502:HNUR:H522 | Active | 201250 | 202320 | 2023 | 20 | 2012 | 50 | 2022 |
| MS_NSG:H502:HNUR:H522 | Active | 201250 | 202320 | 2023 | 20 | 2012 | 50 | 2023 |
| MS_CS_ONWAY:C620:CECS | Active | 202320 | 202320 | 2023 | 20 | 2023 | 20 | 2023 |
| CERT_CHS:H518:HCPS | Active | 202320 | 202320 | 2023 | 20 | 2023 | 20 | 2023 |
| MS_BUS:B435:BMKT | Active | 202320 | 202320 | 2023 | 20 | 2023 | 20 | 2023 |
| MS_BUS:B434:BFIE | Active | 202320 | 202320 | 2023 | 20 | 2023 | 20 | 2023 |
| BS_PHD_CS:C620:CECS | Active | 202320 | 202320 | 2023 | 20 | 2023 | 20 | 2023 |
| MS_BUS:B517:BMGT | Active | 202120 | 202320 | 2023 | 20 | 2021 | 20 | 2021 |
| MS_BUS:B517:BMGT | Active | 202120 | 202320 | 2023 | 20 | 2021 | 20 | 2022 |
| MS_BUS:B517:BMGT | Active | 202120 | 202320 | 2023 | 20 | 2021 | 20 | 2023 |
I used List.Numbers to generate the years column using the From Year and To Year and now I need to do the same for From Term and To Term. The expected result is one row per term, so for example it would be something like this (once I combine the year and term again)
| Merged Program Coding | Simplified Program Status | From | To | To Year | To Term | From Year | From Term | Term Codes |
| MS_NSG:H502:HNUR:H522 | Active | 201250 | 202320 | 2023 | 20 | 2012 | 50 | 201250 |
| MS_NSG:H502:HNUR:H522 | Active | 201250 | 202320 | 2023 | 20 | 2012 | 50 | 201310 |
| MS_NSG:H502:HNUR:H522 | Active | 201250 | 202320 | 2023 | 20 | 2012 | 50 | 201320 |
| MS_NSG:H502:HNUR:H522 | Active | 201250 | 202320 | 2023 | 20 | 2012 | 50 | 201430 |
| MS_NSG:H502:HNUR:H522 | Active | 201250 | 202320 | 2023 | 20 | 2012 | 50 | 201440 |
| MS_NSG:H502:HNUR:H522 | Active | 201250 | 202320 | 2023 | 20 | 2012 | 50 | 201450 |
| MS_NSG:H502:HNUR:H522 | Active | 201250 | 202320 | 2023 | 20 | 2012 | 50 | 201510 |
| MS_NSG:H502:HNUR:H522 | Active | 201250 | 202320 | 2023 | 20 | 2012 | 50 | 201520 |