Hitachi Vantara Pentaho Community Forums
Results 1 to 3 of 3

Thread: a simple problem

  1. #1
    Join Date
    Sep 2007
    Posts
    3

    Angry a simple problem

    I use the below sytax:

    member measures.cal as 'iif(measures.a=1,"",measures.a)'

    It doesn't work.

    In my data there is many of measures.a equal 1, so i don't want to show them,only want a space instead.when measures.a is not equal 1,then show them.
    But in the IIF function ,the 2nd and the 3rd parameter must be the same type.

    How cound I do that?

  2. #2
    Join Date
    Nov 1999
    Posts
    1,618

    Default

    Use the CAST operator to make the arguments the same type:

    Code:
    member measures.cal as ' iif(measures.a = 1, "", cast(measures.a as string)) '
    You could also use the FORMAT function:

    Code:
    member measures.cal as ' iif(measures.a = 1, "", format(measures.a, "#,###.00#")) '
    Julian

  3. #3
    Join Date
    Sep 2007
    Posts
    3

    Default how to set empty

    Thanks!

    member measures.cal as ' iif(measures.a = 1, "", cast(measures.a as string)) ' is work.

    But when i use " NON EMPTY ..... on rows from cubename", it also display the row.

    I think it must set the 2nd arguments a empty value like below:

    member measures.cal as ' iif(measures.a = 1, null, cast(measures.a as string)) '

    how could i set a empty value?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Privacy Policy | Legal Notices | Safe Harbor Privacy Policy

Copyright © 2005 - 2019 Hitachi Vantara Corporation. All Rights Reserved.