Skip to Content
author's profile photo Former Member
Former Member

Why I use MAX webi return incorrect values?

Dear Expert,

I'm facing problem with using MAX function in webi.

Please see the detail below:

New_Var=If(IsNull(Count([Master.PERNR];Distinct) Where ([Master.Year]=2008))) Then 0 Else Count([Master.PERNR];Distinct) Where ([Master.Year]=2008)

When I use specific year(2008) as above code it work fine.

But If I change to use MAX it show different result.

New_Var=If(IsNull(Count([Master.PERNR];Distinct) Where ([Master.Year]=Min([Master.Year])))) Then 0 Else Count([Master.PERNR];Distinct) Where ([Master.Year]=Min([Master.Year]))

It provides wrong results

.

How should I do with my code above to provide correct result?

Please help me.

Best regards,

Chenna Yon

1.png (18.5 kB)
2.png (18.6 kB)
Add a comment
10|10000 characters needed characters exceeded

Related questions

2 Answers

  • Best Answer
    Posted on Jun 06, 2014 at 05:25 AM

    One guess - try the below one:

    New_Var=If(IsNull(Count([Master.PERNR];Distinct) Where ([Master.Year]=(Min([Master.Year])In Block)))) Then 0 Else Count([Master.PERNR];Distinct) Where ([Master.Year]=(Min([Master.Year])In Block))

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jun 06, 2014 at 05:21 AM

    Hi Chenna Yon,

    Change the projection function of your measure to NONE (instead SUM) and try the same variable.

    or

    Try

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.