Forum Discussion

Flo_Rod's avatar
Flo_Rod
Cloud Apps
03-12-2024
Solved

Using Rankdesc to create a custom Column

Hi, 
I am a sisense newbie. I am trying to create a custom column in the data model to rank latest week and other weeks from latest to oldest. I am using a live model connected to a snowflake database.  The data is such that once a week its refreshed and customer purchases for the range of that week are entered against a single day. Whenever I try to save this formula, I am getting an error. Can someone help me fix this formula please.

Formula: RANKDESC("purchase date")
Error: Parsing failed: SQL compilation error: Unknown function RANKDESC
  • DRay's avatar
    DRay
    03-12-2024

    Hi Flo_Rod,

    Thank you. Queries against a Live Data Source use the data source syntax, not the Sisense syntax. Here is the Snowflake documentation for RANK. Can you take a look at that and let us know if it helps?

    Thank you.

  • Thank you DRay I ended up changing the SQL query  in the data model. The function I used was:
    DENSE_RANK() OVER (ORDER BY PURCHASE_DATE DESC) AS CC_PURCHASE_DATE_RANK
     This created the custom column I required.

4 Replies

Replies have been turned off for this discussion
  • Hi Flo_Rod.

    Can you tell us what the error message says? That should help us figure out what the issue is.

     

    • Flo_Rod's avatar
      Flo_Rod
      Cloud Apps
      Formula: RANKDESC("purchase date")
      Error: Parsing failed: SQL compilation error: Unknown function RANKDESC
      • DRay's avatar
        DRay
        Admin

        Hi Flo_Rod,

        Thank you. Queries against a Live Data Source use the data source syntax, not the Sisense syntax. Here is the Snowflake documentation for RANK. Can you take a look at that and let us know if it helps?

        Thank you.