Hi All,
I have a daily KPIs dashboard with consecutive days columns and KPIs as rows. The workbook is connected to a sql database and is refreshed on a daily basis. Once the refresh is completed I have to select the latest column (lets say yesterday) and copy right it to get all data for today.
What I am looking for is a code which compares the latest day in the KPIs table ("KPIs[Days]") with a table/range with all days available from the database ("Current[Days]"). If Current[Days] have 1 day which is not included in the KPIs[Days] then add a column to the right of the latest column from KPIs table (same if there are 5 missing days then adds 5 columns to the right). Ideally, after refreshing all the querys the KPIs table it is autoexpanded with new colomuns (days) to the right hence "today" day is always included.
Thank you all in advance for your help.
I have a daily KPIs dashboard with consecutive days columns and KPIs as rows. The workbook is connected to a sql database and is refreshed on a daily basis. Once the refresh is completed I have to select the latest column (lets say yesterday) and copy right it to get all data for today.
What I am looking for is a code which compares the latest day in the KPIs table ("KPIs[Days]") with a table/range with all days available from the database ("Current[Days]"). If Current[Days] have 1 day which is not included in the KPIs[Days] then add a column to the right of the latest column from KPIs table (same if there are 5 missing days then adds 5 columns to the right). Ideally, after refreshing all the querys the KPIs table it is autoexpanded with new colomuns (days) to the right hence "today" day is always included.
Thank you all in advance for your help.