Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
4 years ago
Solved

extract as table

How do I extract the data in below link as table pl?

 

https://trendlyne.com/equity/calendar/all/all/?start_date=2021-11-09&end_date=2021-12-08&corporate_actions=Results

Used web scraper to get to site map. Can help to map to what the query shud read in pbi?

{"_id":"cal","startUrl":["https://trendlyne.com/equity/calendar/all/all/?start_date=2021-11-09&end_date=2021-12-31&corporate_actions=Results"],"selectors":[{"id":"cal","parentSelectors":["_root"],"type":"SelectorTable","delay":0,"multiple":true,"selector":"table#DataTables_Table_0","tableDataRowSelector":"tbody tr","tableHeaderRowSelector":"thead tr","columns":[{"extract":true,"header":"Stock","name":"Stock"},{"extract":true,"header":"Ex-date","name":"Ex-date"},{"extract":true,"header":"Event","name":"Event"},{"extract":true,"header":"Notes","name":"Notes"}]},{"id":"caldetails","parentSelectors":["_root"],"type":"SelectorLink","selector":".DTFC_Cloned a[target]","multiple":true,"delay":0}]}

 

 

  • Hi, Anonymous 

    You can follow the steps below to store  previous data tables.
    1.disable the query refresh of  prvs table

    2. add a static column 'CreatedDate'

    Then use  Union function to append the previous tables and current table in Report View.

     

    In fact ,PowerBI is not suitable for the import and storage of historical data.

    If possible, I suggest that you store these historical data through SQL SSMS / EXCEL sheets each time.

     

    Best Regards,
    Community Support Team _ Eason

     

7 Replies

    • Anonymous's avatar
      Anonymous
      Not applicable

      Appreciate the revert and perfect solution! missed the step.

      An extension of Q: Is there a way to add date when the data was downloaded as every day the records can change?

       

  • VijayP's avatar
    VijayP
    Community Champion

    Anonymous 
    Create a custom column and add this function which creates today's date based on your regional settings and whenever you are downloading this represent that day automatically. But it changes based on each current day

    DateTimeZone.LocalNow()

     

    if you find my solution is fine then please mark this as accepted solution

  • Anonymous's avatar
    Anonymous
    Not applicable

    Thanks. Anyways date can be locked to current and retained to use as history to trend you think?

    • v-easonf-msft's avatar
      v-easonf-msft
      Community Support

      Hi, Anonymous 

      Date created by function 'DateTimeZone.LocalNow()'  is dynamic and will change based on ‘today’. It will not be retained to use as history once you refresh the report.

      I think you may also need to disable the option 'include in report refresh'.

       

      Best Regards,
      Community Support Team _ Eason

      • Anonymous's avatar
        Anonymous
        Not applicable

        Thanks for the solution. is there a workaround to keep the prvs date static and then append new data by writing a code ?