Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Dynamically Assign M1 , M2, M3 to certain time period in qlik sense
(Here M1 , M2, M3 are months )
How can add calculated column to get the expected result as shown below:
Table:
Season ID | Start Year | End year | Season month | Season Month year |
1 | 2019 | 2020 | 10 | Oct-19 |
1 | 2019 | 2020 | 11 | Nov-19 |
1 | 2019 | 2020 | 12 | Dec-19 |
1 | 2019 | 2020 | 1 | Jan-20 |
1 | 2019 | 2020 | 2 | Feb-20 |
2 | 2019 | 2019 | 6 | Jun-19 |
2 | 2019 | 2019 | 7 | Jul-19 |
2 | 2019 | 2019 | 8 | Aug-19 |
2 | 2019 | 2019 | 9 | Sep-19 |
2 | 2019 | 2019 | 10 | Oct-19 |
2 | 2019 | 2019 | 11 | Nov-19 |
Expected result Column 6 "Calculated field"
Season ID | Start Year | End year | Season month | Season Month year | Calculated Field |
1 | 2019 | 2020 | 10 | Oct-19 | M1 |
1 | 2019 | 2020 | 11 | Nov-19 | M2 |
1 | 2019 | 2020 | 12 | Dec-19 | M3 |
1 | 2019 | 2020 | 1 | Jan-20 | M4 |
1 | 2019 | 2020 | 2 | Feb-20 | M5 |
2 | 2019 | 2019 | 6 | Jun-19 | M1 |
2 | 2019 | 2019 | 7 | Jul-19 | M2 |
2 | 2019 | 2019 | 8 | Aug-19 | M3 |
2 | 2019 | 2019 | 9 | Sep-19 | M4 |
2 | 2019 | 2019 | 10 | Oct-19 | M5 |
2 | 2019 | 2019 | 11 | Nov-19 | M6 |
Thank a lot Frank, that works perfectly for my scenario , You saved my day 🙂
see attached qvw.
---------------------------------------------------------------------------------
Table:
LOAD RowNo() as Row,
[Season ID],
[Start Year],
[End year],
[Season month],
[Season Month year],
'M' & Autonumber([Season Month year],[Season ID]) as Test
FROM
[https://community.qlik.com/t5/Community-Corner/Dynamically-Assign-M1-M2-M3-dynamically-to-certain-ti...]
(html, codepage is 1252, embedded labels, table is @1) ;
-------------------------------------------------------------------------------------
Thank a lot Frank, that works perfectly for my scenario , You saved my day 🙂