Hi Need help to write logic: if 'DATE1' is less than current date, then create a new table and refresh . The purpose is to fetch new data if avlbl everyday automatically if possible from same link and update to same table per new date or add table as a loop
Sharing the file as well if helps context
5DAY daily.pbix
----------------------------
let
Source = Csv.Document(Web.Contents("https://www1.nseindia.com/products/content/sec_bhavdata_full.csv"),[Delimiter=",", Columns=15, Encoding=1252, QuoteStyle=QuoteStyle.None]),
#"Promoted Headers" = Table.PromoteHeaders(Source, [PromoteAllScalars=true]),
#"Changed Type" = Table.TransformColumnTypes(#"Promoted Headers",{{"SYMBOL", type text}, {" SERIES", type text}, {" DATE1", type date}, {" PREV_CLOSE", type number}, {" OPEN_PRICE", type number}, {" HIGH_PRICE", type number}, {" LOW_PRICE", type number}, {" LAST_PRICE", type number}, {" CLOSE_PRICE", type number}, {" AVG_PRICE", type number}, {" TTL_TRD_QNTY", Int64.Type}, {" TURNOVER_LACS", type number}, {" NO_OF_TRADES", Int64.Type}, {" DELIV_QTY", type text}, {" DELIV_PER", type text}})
in
#"Changed Type"
Sharing the file as well if helps context
5DAY daily.pbix
----------------------------
let
Source = Csv.Document(Web.Contents("https://www1.nseindia.com/products/content/sec_bhavdata_full.csv"),[Delimiter=",", Columns=15, Encoding=1252, QuoteStyle=QuoteStyle.None]),
#"Promoted Headers" = Table.PromoteHeaders(Source, [PromoteAllScalars=true]),
#"Changed Type" = Table.TransformColumnTypes(#"Promoted Headers",{{"SYMBOL", type text}, {" SERIES", type text}, {" DATE1", type date}, {" PREV_CLOSE", type number}, {" OPEN_PRICE", type number}, {" HIGH_PRICE", type number}, {" LOW_PRICE", type number}, {" LAST_PRICE", type number}, {" CLOSE_PRICE", type number}, {" AVG_PRICE", type number}, {" TTL_TRD_QNTY", Int64.Type}, {" TURNOVER_LACS", type number}, {" NO_OF_TRADES", Int64.Type}, {" DELIV_QTY", type text}, {" DELIV_PER", type text}})
in
#"Changed Type"