Thursday, 10 August 2023

P10

 Subject: Request for One Day Leave for Daughter-in-Law's Mundan Ceremony


Dear [Manager's Name],


I hope this email finds you well. I am writing to request a one-day leave on [Date] to attend my daughter-in-law's Mundan ceremony, which will be taking place at Tirupathi. This event holds significant cultural and religious importance for my family, and I would be honored to be present to support and participate in this special occasion.


I understand the importance of my responsibilities at work and assure you that I will ensure a smooth handover of my tasks to a colleague or provide any necessary guidance to ensure that there is no disruption during my absence.


I apologize for any inconvenience this leave may cause and appreciate your understanding and consideration of my request. I will make sure to complete any pending work before my leave and ensure that my absence does not impact the team's progress.


Thank you for your attention to this matter. I am looking forward to your favorable response.


Best regards,

[Your Name]

P9

 let

    // Load your calendar and iterations tables

    CalendarTable = ...,

    IterationsTable = ...,

    

    // Merge the tables without any key

    CombinedTable = Table.NestedJoin(CalendarTable, {}, IterationsTable, {}, "Merged", JoinKind.LeftOuter),

    

    // Define a custom function to check the condition

    CheckCondition = (row) => row[DateUTC] = row[StartDate],

    

    // Expand the merged table with new columns based on the condition

    ExpandedTable = Table.AddColumn(CombinedTable, "ExpandedColumns", each if CheckCondition(_) then [Column1, Column2, ...] else null),

    

    // Filter out rows where the condition is not met and remove unnecessary columns

    FilteredTable = Table.SelectRows(ExpandedTable, each [ExpandedColumns] <> null),

    FinalTable = Table.RemoveColumns(FilteredTable, {"ExpandedColumns"})


in

    FinalTable

Tuesday, 1 August 2023

P8

 let

    // Assuming "Calendar3" is the name of your table and "StartDate" is the name of your date column


    // Create a list of all unique dates in the "StartDate" column

    DatesList = List.Sort(List.Distinct(Calendar3[StartDate])),


    // Find the minimum and maximum dates from the list

    MinDate = List.Min(DatesList),

    MaxDate = List.Max(DatesList),


    // Generate a list of all dates between the minimum and maximum dates

    AllDates = List.Dates(MinDate, Duration.From(1), Duration.From(1)),


    // Add a custom column to fill missing dates

    CustomColumn = List.Generate(

        () => [DateIndex = 0, CurrentDate = MinDate],

        each [DateIndex] < List.Count(AllDates),

        each [DateIndex = [DateIndex] + 1, CurrentDate = AllDates{[DateIndex]}],

        each [CurrentDate]

    )

in

    CustomColumn


P7

 let

    // Assuming "Calendar3" is the name of your table and "StartDate" is the name of your date column


    // Create a list of all unique dates in the "StartDate" column

    DatesList = List.Sort(List.Distinct(Calendar3[StartDate])),


    // Find the minimum and maximum dates from the list

    MinDate = List.Min(DatesList),

    MaxDate = List.Max(DatesList),


    // Generate a list of all dates between the minimum and maximum dates

    AllDates = List.Dates(MinDate, Duration.From(1), Duration.From(1)),


    // Add a custom column to fill missing dates

    CustomColumn = List.Generate(

        () => [DateIndex = 0, CurrentDate = MinDate],

        each [DateIndex] < List.Count(AllDates),

        each [DateIndex = [DateIndex] + 1, CurrentDate = AllDates{[DateIndex]}],

        each [CurrentDate]

    ),

    FilledDates = Table.FromList(CustomColumn, Splitter.SplitByNothing()),


    // Merge the filled dates back into the "Calendar3" table

    MergedTable = Table.NestedJoin(Calendar3, {"StartDate"}, FilledDates, {"Column1"}, "Expanded", JoinKind.LeftOuter),


    // Expand the filled dates column

    ExpandedTable = Table.ExpandTableColumn(MergedTable, "Expanded", {"Column1"}, {"FilledDate"}),


    // Remove the temporary column used for the join

    CleanedTable = Table.RemoveColumns(ExpandedTable, {"Column1"})

in

    CleanedTable


P6

 let

    // Assuming "Calendar3" is the name of your table and "StartDate" is the name of your date column


    // Create a list of all unique dates in the "StartDate" column

    DatesList = List.Sort(List.Distinct(Calendar3[StartDate])),


    // Find the minimum and maximum dates from the list

    MinDate = List.Min(DatesList),

    MaxDate = List.Max(DatesList),


    // Generate a list of all dates between the minimum and maximum dates

    AllDates = List.Dates(MinDate, Duration.From(1), Duration.From(1)),


    // Add a custom column to fill missing dates

    CustomColumn = List.Generate(

        () => [DateIndex = 0, CurrentDate = MinDate],

        each [DateIndex] < List.Count(AllDates),

        each [DateIndex = [DateIndex] + 1, CurrentDate = AllDates{[DateIndex]}],

        each [CurrentDate]

    ),

    FilledDates = Table.FromList(CustomColumn, Splitter.SplitByNothing())

in

    Table.AddColumn(Calendar3, "FilledDate", each Fil

ledDates{[DateIndex]})

P5

 let

    // Assuming "Table" is the name of your table and "Date" is the name of your date column


    // Create a list of all unique dates in the "Date" column

    DatesList = List.Sort(List.Distinct(Table[Date])),


    // Find the minimum and maximum dates from the list

    MinDate = List.Min(DatesList),

    MaxDate = List.Max(DatesList),


    // Generate a list of all dates between the minimum and maximum dates

    AllDates = List.Dates(MinDate, Duration.From(1), Duration.From(1)),


    // Add a custom column to fill missing dates

    CustomColumn = List.Generate(

        () => [DateIndex = 0, CurrentDate = MinDate],

        each [DateIndex] < List.Count(AllDates),

        each [DateIndex = [DateIndex] + 1, CurrentDate = AllDates{[DateIndex]}],

        each [CurrentDate]

    ),

    FilledDates = Table.FromList(CustomColumn, Splitter.SplitByNothing())

in

    Table.AddColumn(Table, "FilledDate", each FilledDates{[DateIndex]})


P4

 let

    // Assuming "Table" is the name of your table and "Date" is the name of your date column


    // Find the previous date with a non-null value

    FillDates = (currentDate) =>

        let

            previousDate = List.LastN(Table.SelectRows(Table, each [Date] < currentDate and [Date] <> null), 1),

            result = if List.Count(previousDate) = 0 then currentDate else Record.Field(previousDate{0}, "Date")

        in

            result,


    // Fill null values based on the previous day's value

    CustomColumn = Table.AddColumn(Table, "FilledDate", each FillDates([Date])

in

  

  CustomColumn

P3

 let

    Source = CalendarTable,

    IterationsTable = IterationsTable,

    MergeCondition = Table.AddColumn(Source, "Merged", (ct) => 

        let

            calendarDate = ct[CalendarDate],

            matchingIterations = Table.SelectRows(IterationsTable, each [Start Date] <= calendarDate and [End Date] >= calendarDate and [Sprint Name] <> null),

            sprintNames = Text.Combine(matchingIterations[Sprint Name], ", ")

        in

            sprintNames, 

        type text

    ),

    Expanded = Table.ExpandTableColumn(MergeCondition, "Merged", {"Sprint Name"}, {"Sprint Name"})

in

    Expanded

P2

 = if [CalendarDate] >= List.Min(Table.SelectRows(IterationsTable, each [Start Date] <= c[CalendarDate] and [End Date] >= c[CalendarDate] and [Sprint Name] <> null)[Start Date]) and 

     [CalendarDate] <= List.Max(Table.SelectRows(IterationsTable, each [Start Date] <= c[CalendarDate] and [End Date] >= c[CalendarDate] and [Sprint Name] <> null)[End Date]) then 

     Text.Combine(Table.SelectRows(IterationsTable, each [Start Date] <= c[CalendarDate] and [End Date] >= c[CalendarDate] and [Sprint Name] <> null)[Sprint Name], ", ") 

   else null


p1

 = if [Date] >= List.Min(Table.SelectRows(SprintTable, each [StartDate] <= [Date] and [EndDate] >= [Date] and [SprintName] <> null)[StartDate]) and

[Date] <= List.Max(Table.SelectRows(SprintTable, each [StartDate] <= [Date] and [EndDate] >= [Date] and [SprintName] <> null)[EndDate]) then Text.Combine(Table.SelectRows(SprintTable, each [StartDate] <= [Date] and [EndDate] >= [Date] and [SprintName] <> null)[SprintName], ", ") else null ============= = if [Date] >= List.Min(Table.SelectRows(IterationsTable, each [Start Date] <= [Date] and [End Date] >= [Date] and [Sprint Name] <> null)[Start Date]) and [Date] <= List.Max(Table.SelectRows(IterationsTable, each [Start Date] <= [Date] and [End Date] >= [Date] and [Sprint Name] <> null)[End Date]) then Text.Combine(Table.SelectRows(IterationsTable, each [Start Date] <= [Date] and [End Date] >= [Date] and [Sprint Name] <> null)[Sprint Name], ", ") else null