Forum Discussion
Load multiple files at a time
- 5 years ago
Hi Anonymous
This is odd, I can't figure out the reason for the error. I've checked your JSON files and they are valid JSON so I don't know why PQ is generating an error.
I fixed the problem by manuallay editing the Transform Sample File query and it now works.
Please download this PBIX file and test it with your files.
You will need to edit the Source step of the ev query sothat it points to your directory where you have your files.
Regards
Phil
Hi Anonymous
You shouldn't be modifying the Transform Sample File query. If you need to add transformation steps do it in the main ev query.
The PBIX file I provided has working code that works when you add more files to the folder.
Initially the query was loading 2 JSON files. The fist had 20 records
and the 2nd had just 1 record
Expanding those tables and then expanding the records inside the tables gives 24 rows of data
Now I added 3 more JSON files to the same directory - I just made copies of the files I had. The file contents don't matter, this is just for demonstration.
Refreshing the query shows that it is now seeing 5 files - that is correct.
Expanding the tables/records gives 71 rows of data (you can't see them all in this screenshot)
So the query is working to pick up new JSON files correctly. I don't know what you are doing and why you are having trouble.
If you just use my PBIX and alter the Source step to point to the directory you are using where the JSON files are, it should work
If you are still having issues please provide your PBIX file so I can check the code you are using. And also provide some screenshots of the data with null values. And provide copies of these new files that aren't working.
regards
Phil
- Anonymous5 years agoNot applicable
PhilipTreacy I have added transformation steps in main query as you said, then after I have added files in folder. Still I see null values in the new file. I have attached the new json file and pbix file as well for reference.
Steps I have created the pbix file
https://www.dropbox.com/scl/fi/nss6no3uyq9yvqj8rj6iv/Steps.docx?dl=0&rlkey=r8y24sw4640y49wwzgfttzvguLink for pbix file:
https://www.dropbox.com/s/zjjf291irsdswkb/Srivally.pbix?dl=0
Link for new json file:
https://www.dropbox.com/s/hcjryr5n3nu51c6/Energy_EV_Meter_47_2021-02-03.json?dl=0https://www.dropbox.com/s/zjjf291irsdswkb/Srivally.pbix?dl=0
Regards,
Sri