Querya

<nav class="toc"><ol class="toc-level toc-level-1"><li class="toc-item toc-item-h2"><a class="toc-link toc-link-h2" href="#csquerya">=CS.QUERYA</a><ol class="toc-level toc-level-2"><li class="toc-item toc-item-h3"><a class="toc-link toc-link-h3" href="#use-case-scenarios">Use Case Scenarios</a></li></ol></li><li class="toc-item toc-item-h2"><a class="toc-link toc-link-h2" href="#querya---syntax">QUERYA - Syntax</a><ol class="toc-level toc-level-2"><li class="toc-item toc-item-h3"><a class="toc-link toc-link-h3" href="#function-arguments">Function arguments</a></li><li class="toc-item toc-item-h3"><a class="toc-link toc-link-h3" href="#function-argument-descriptions">Function argument descriptions</a></li><li class="toc-item toc-item-h3"><a class="toc-link toc-link-h3" href="#parameters---absolute-vs-relative">PARAMETERS - Absolute vs. Relative</a></li></ol></li><li class="toc-item toc-item-h2"><a class="toc-link toc-link-h2" href="#querya---examples">QUERYA - Examples</a><ol class="toc-level toc-level-2"><li class="toc-item toc-item-h3"><a class="toc-link toc-link-h3" href="#troubleshooting">Troubleshooting</a></li></ol></li><li class="toc-item toc-item-h2"><a class="toc-link toc-link-h2" href="#additional-resources">Additional Resources</a></li></ol></nav><h2 id="csquerya">=CS.QUERYA</h2> <p>In its simplest form, the QUERYA function says</p> <pre><code>=CS.QUERYA(what provider, what endpoint, what parameters, what arguments) </code></pre> <p><img src="https://res.cloudinary.com/cryptosheets/image/upload/cryptosheets-docs/excel/functions/csQUERYA-syntax.png" alt="image"></p> <p><img src="https://res.cloudinary.com/cryptosheets/image/upload/cryptosheets-docs/excel/functions/csQUERYA-autocomplete.png" alt="image"></p> <p><img src="https://res.cloudinary.com/cryptosheets/image/upload/cryptosheets-docs/google/functions/csQUERYA-autocomplete.png" alt="image"></p> <h3 id="use-case-scenarios">Use Case Scenarios</h3> <blockquote> <p>Use =CS.QUERYA() when you need maximum flexibility across all available providers including the ability to call any of their specific endpoints or datasets. This function is a more advanced &#x26; flexible version of the original CS.QUERY custom function. QUERYA can take any combination of any parameters and/or and in any order as long as each input and value are paired. It also allows you to combine relative and absolute references in the same input and value pairs without having to use a nested array wrapped in {curly brackets}. This seemingly minor detail is incredibly important in the certain situations making CS.QUERYA a powerful tool to have.</p> </blockquote> <hr> <h2 id="querya---syntax">QUERYA - Syntax</h2> <h3 id="function-arguments">Function arguments</h3> <p>Arguments: <code>=CS.QUERYA("provider","endpoint","parameters","parameterValues","args","argValues") </code></p> <p>Example Values: <code>=CS.QUERYA("Cryptunit","Earnings Auto","device","GPU")</code></p> <h3 id="function-argument-descriptions">Function argument descriptions</h3> <p><img src="https://res.cloudinary.com/cryptosheets/image/upload/cryptosheets-docs/excel/functions/csQUERYA-syntax-autocomplete.png" alt="image"></p> <p><img src="https://res.cloudinary.com/cryptosheets/image/upload/cryptosheets-docs/excel/functions/csQUERYA-syntax-example.gif" alt="image"></p> <ul> <li><strong>provider</strong>: Data provider, ex. Cryptunit. [string] required</li> <li><strong>endpoint</strong>: Data endpoint of provider, ex. 'earnings-auto'. [string] required</li> <li><strong>parameters</strong>: List of path and query parameters in comma separated pairs in any order [string] optional</li> <li><strong>args</strong>: Optional: , ex. limit, fields [any] optional</li> </ul> <h3 id="parameters---absolute-vs-relative">PARAMETERS - Absolute vs. Relative</h3> <p><strong>Absolute Parameter Values</strong></p> <p>Formulas using <strong>absolute values</strong> for arguments with multiple parameters using CS.QUERYA can be referenced anywhere in the formula query string as long as they are paired together:</p> <p><code>=CS.QUERYA("Cryptunit","Earnings Auto","device","GPU")</code></p> <p><strong>Relative Parameter Values</strong></p> <p>Formulas using <strong>referenced values</strong> for arguments with multiple parameters using CS.QUERYA can be referenced anywhere and in any order within the formula query string as long as they are paired together:</p> <p><code>=CS.QUERYA("provider","endoint","arg","argValue","parameter","parameterValue"...)</code></p> <p><strong>Combining Relative AND Absolute Parameter Values</strong></p> <p>One of the features about CS.QUERYA vs CS.QUERY that makes it so flexible is the ability to combine any configuration of relative and absolute values at any point in the formula query string without being bound by {"nested:arrays"} as long as they are paired together:</p> <p><code>=CS.QUERYA("provider","endoint","arg","argValue","parameter","parameterValue"...)</code></p> <p><img src="https://res.cloudinary.com/cryptosheets/image/upload/cryptosheets-docs/excel/functions/csQUERYA-relative-cells.png" alt="image"></p> <p><img src="https://res.cloudinary.com/cryptosheets/image/upload/cryptosheets-docs/excel/functions/csQUERYA-relative-example.gif" alt="image"></p> <p>Click here to search for data providers and endpoints</p> <hr> <h2 id="querya---examples">QUERYA - Examples</h2> <p><strong>TIP</strong>: <em>Try copying + pasting the example formulas directly into your worksheet</em></p> <p><strong>Example 1:</strong></p> <blockquote> <p>=CS.QUERYA("CryptUnit","earnings auto","_fields","coin_ticker,reward_day_usd,reward_month_usd","device","GPU","hashrate","5000")</p> </blockquote> <p><img src="https://res.cloudinary.com/cryptosheets/image/upload/cryptosheets-docs/excel/functions/csQUERYA-example1.png" alt="image"></p> <p><strong>Example 2:</strong></p> <blockquote> <p>=CS.QUERYA("Compound","governance accounts","_fields","display_name,vote_weight,votes")</p> </blockquote> <p><img src="https://res.cloudinary.com/cryptosheets/image/upload/cryptosheets-docs/excel/functions/csQUERYA-example2.png" alt="image"></p> <p><strong>Example 3:</strong></p> <blockquote> <p>=CS.QUERYA("Paradigm","performance","_fields","symbol,sharpe1MLibor")</p> </blockquote> <p><img src="https://res.cloudinary.com/cryptosheets/image/upload/cryptosheets-docs/excel/functions/csQUERYA-example3.png" alt="image"></p> <p><strong>Example 4:</strong></p> <p><img src="https://res.cloudinary.com/cryptosheets/image/upload/cryptosheets-docs/excel/functions/csQUERYA-example4.gif" alt="image"></p> <h3 id="troubleshooting">Troubleshooting</h3> <ol> <li> <p>Check your formula syntax for carefully, different functions for the same data may have slightly different required syntax</p> </li> <li> <p>Check the <strong>required arguments</strong> for your function vs the <strong>optional arguments</strong></p> </li> <li> <p>Check your data &#x26; API quotas and limits</p> </li> <li> <p>Check your formulas carefully</p> </li> <li> <p>Check your relative references</p> </li> <li> <p>Use Excels <strong>error checking tools</strong></p> </li> <li> <p>Check Excels help sections</p> </li> <li> <p>Error Response Codes Reference</p> <ul> <li><strong>#N/A</strong> OK – Everything worked as expected</li> <li><strong>#BUSY</strong> Heavy query and/or unauthorized – Your User/Password API Keys are incorrect</li> <li><strong>#LIMIT</strong> Forbidden – You are not subscribed to the data feed requested</li> <li><strong>Other</strong> Something else? Reach out to us directly</li> </ul> </li> </ol> <h2 id="additional-resources">Additional Resources</h2> <p><em>For Microsoft Excel</em></p> <ul> <li>Web browsers used by add-ins</li> <li>Office versions and requirement sets</li> <li>How to check your Office version</li> <li>Install the latest version of Office</li> <li>Custom Function Requirements</li> </ul> <p><em>For Googlesheets</em></p> <ul> <li>Throughput Quotas &#x26; Limits</li> </ul>