我需要按“價格”和升序對取自 API 的陣列進行排序Col7。
我能找到的最好方法是使用下面的公式,但是文本值會中斷,并且標題會消失,因為為了使排序Col7正常作業,我必須強制整個陣列使用VALUE().
=QUERY(SORT(SORT(value(ImportJSON("https://api-apollo.pegaxy.io/v1/pegas/prices/floor?maxBreedCount=7&minBreedCount=0&breedType=Legendary&bloodLine=Hoz", "/", "")),INDEX(VALUE(ImportJSON("https://api-apollo.pegaxy.io/v1/pegas/prices/floor?maxBreedCount=7&minBreedCount=0&breedType=Legendary&bloodLine=Hoz", "/", "")),0,7),FALSE),INDEX(SORT(VALUE(ImportJSON("https://api-apollo.pegaxy.io/v1/pegas/prices/floor?maxBreedCount=7&minBreedCount=0&breedType=Legendary&bloodLine=Hoz", "/", "")),INDEX(VALUE(ImportJSON("https://api-apollo.pegaxy.io/v1/pegas/prices/floor?maxBreedCount=7&minBreedCount=0&breedType=Legendary&bloodLine=Hoz", "/", "")),0,7),FALSE),0,7),FALSE),"select Col1, Col2, Col3, Col4, Col5, Col6, Col7, Col8, Col9, Col10, Col11, Col12, Col13, Col14, Col15 order by Col7 asc offset 0",0)
這是發生的事情:

價格按預期排序,但所有文本均已損壞,標題已消失。
如果我不使用VALUE()排序不能很好地作業,標題會像這樣被扔到下面:

這是沒有的公式VALUE():
=QUERY(SORT(SORT(ImportJSON("https://api-apollo.pegaxy.io/v1/pegas/prices/floor?maxBreedCount=7&minBreedCount=0&breedType=Legendary&bloodLine=Hoz", "/", ""),INDEX(VALUE(ImportJSON("https://api-apollo.pegaxy.io/v1/pegas/prices/floor?maxBreedCount=7&minBreedCount=0&breedType=Legendary&bloodLine=Hoz", "/", "")),0,7),FALSE),INDEX(SORT(VALUE(ImportJSON("https://api-apollo.pegaxy.io/v1/pegas/prices/floor?maxBreedCount=7&minBreedCount=0&breedType=Legendary&bloodLine=Hoz", "/", "")),INDEX(VALUE(ImportJSON("https://api-apollo.pegaxy.io/v1/pegas/prices/floor?maxBreedCount=7&minBreedCount=0&breedType=Legendary&bloodLine=Hoz", "/", "")),0,7),FALSE),0,7),FALSE),"select Col1, Col2, Col3, Col4, Col5, Col6, Col7, Col8, Col9, Col10, Col11, Col12, Col13, Col14, Col15 order by Col7 asc offset 0",0)
這是一個虛擬檔案:
https ://docs.google.com/spreadsheets/d/1ExXtmQ8nyuV1o_UtabVJ-TifIbORItFMWjtN6ZlruWc/edit?usp=sharing
uj5u.com熱心網友回復:
您可以運行 IFERROR(VALUE 來還原所有內容
=ARRAYFORMULA(
QUERY(
IFERROR(
VALUE(
IMPORTJSON(
"https://api-apollo.pegaxy.io/v1/pegas/prices/floor?maxBreedCount=7&minBreedCount=0&breedType=Legendary&bloodLine=Hoz",
"/", "")),
IMPORTJSON(
"https://api-apollo.pegaxy.io/v1/pegas/prices/floor?maxBreedCount=7&minBreedCount=0&breedType=Legendary&bloodLine=Hoz",
"/", "")),
"order by Col7 asc offset 0",0))
轉載請註明出處,本文鏈接:https://www.uj5u.com/qiye/493932.html
