0

For my work I have a datasource from rocket U2 Universe. I already can get the data into programs like Power BI and Excel. I was wondering if there is like a guide with all the SQL commands and other commands we can access.

In particular I would like to add case expression to a query to reduce steps in Power Query.

Kiemo
  • 1
  • 1

2 Answers2

0

I've never used Power Query, but, there is a CASE statement in UniBasic.

Works like so:

BEGIN CASE
  CASE expr
    statement(s)
  CASE expr
    statement(s)
END CASE

Of course this is assuming you are using UniBASIC and not SQL. Not sure what the SQL side does.

0

UniVerse does not support CASE other than within BASIC but it can be done in UniVerseSQL and RetrieVe by using EVAL of RetrieVe's IF THEN ELSE construct. Everything in the EVAL argument must be RetrieVe syntax.

SQL
    SELECT EVAL 'IF DICTname = 1 THEN "A" ELSE "B"' FROM VOCname
or
    SELECT EVAL "IF DICTname = 1 THEN 'A' ELSE 'B'" FROM VOCname

RetrieVe  
    LIST VOCname EVAL "IF DICTname = 1 THEN 'A' ELSE 'B'"

BTW Unless otherwise overridden with a FMT, EVAL will cast the THEN and ELSE values to match the DICTname datatype if it can. So, for example, testing a DICTname configured as a date will result in a date if integers are used for THEN and ELSE.

Galaxiom
  • 109
  • 4