Note that there are some explanatory texts on larger screens.

plurals
  1. POHow to get the max of a sum?
    primarykey
    data
    text
    <p>Can anyone tell me how do I get the Max of a calculated field? Below is an image of my situation:</p> <p><img src="https://i.stack.imgur.com/pHcpy.jpg" alt="Table Structure"><img src="https://i.stack.imgur.com/oTV8r.png" alt="Grouping Pic"></p> <p>Note that Flag is of type <code>int</code>.</p> <p>I want to write the expression in the image , but when I use it, it kinda does:</p> <pre><code>Sum(Sum(Fields!Flag.value)) </code></pre> <p>Can anyone help me out on this. I think I need to add scope for the <code>Sum(Flag)</code> but when I add the group scope as EMPID as:</p> <pre><code>=iif(SUM(Fields!Flag.value,"Fields!EmpID.Value")&gt;2,"RED",nothing) </code></pre> <p>It throws me an error saying something about the scope.</p> <p><strong>EDIT:</strong></p> <p>I need attendance of each employees. FLAG is basically 1 if absent and 0 if anything else.</p> <p>The bottom row(Flag,Date,Status,Comment). Now I have an alert There:</p> <pre><code>=iif(Fields!Flag.Value=1,"RED",Nothing) </code></pre> <p>Beside the Textbox(Textbox62) in middle row(EmpID,EmpName) I did Expression:SUM(Flag) and in the Fill section in Text Box Properties i have done:</p> <pre><code>=iif(SUM(Fields!Flag.value,"Fields!EmpID.Value")&gt;2,"RED",nothing) </code></pre> <p>So the above expression creates an alert if employee is absent more than 3 days.</p> <p>The top most row(Department,Manager) can be drilled down for to see more detailed view of the report. Now my problem is, in the column (FLAG) i need to create a Background color change if any employee in a particular department is absent more than 3 days.so that we do not have to drill down all the departments in order see if any employee is absent or not. So my approach was to see the Max(Sum(Flag))>2 then create color change. I tried:</p> <pre><code>=iif(MAX(Sum(Fields!Flag.Value))&gt;2,"Red",Nothing) </code></pre> <p>It does not work at the Department level as it basically considers (SUM(Sum(Flag))).</p> <p>Thanks................</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload