Filter based on a condition

  • Hello,
    I need to filter out a group when condition Sum(Fee) = 0 is met (the one with the dark blue background color). But the problem is that i have two textboxes that have the same name and only one (the one with the dark blue background) should be checked. Could anyone help me to do filtering? Please let me know if you need further information.
    Best regards
    Lukas

  • Could you instead provide the .rdl file, rather than an export from Excel? We'll know what your report looks like then, and what your object names are, etc.

    Thom~

    Excuse my typos and sometimes awful grammar. My fingers work faster than my brain does.
    Larnu.uk

  • .rdl file won't give you any data, right? I can't reveal any data.

  • lukaszpiech - Monday, February 27, 2017 8:55 AM

    .rdl file won't give you any data, right? I can't reveal any data.

    Not unless you've hard coded any in your report, no. The rdl defines the report layout, and holds details of your dataset. The only thing it might reveal is your datasources credentials, IF you are storing them within the report. If so, i would suggest removing those first (you can copy the file and edit the xml of the file in any plain text editor). If you're using SSRS 2012 onwards, and using a shared datasource/dataset, this won't be revealed.

    On a side note though, it is impossible to have 2 textboxes (or objects) with the same name. If you did, somehow, have two objects with the same name the report would fail to generate.

    Without seeing your report, personally I would put a filter on your tablix in the tablix properties (I haven't opened your xlsx file, as I can't open untrusted xls(x) sources at work).

    Thom~

    Excuse my typos and sometimes awful grammar. My fingers work faster than my brain does.
    Larnu.uk

  • Thom A, thank you very much for response! You are right about textboxes, their names are diffrent, they only have the same value. I have attached a .rdl file so that should help you help me 🙂
    So one more time i'll try to explain what i need:
    I want to hide hole group ("Details") in Tablix 5 based on condition where SUM of fields in row containing textbox with value "Fee" on a MidnightBlue background is equal to 0 (zero)

  • I can't actually see a details group on your Tablix 5, only the Group Rodzaj.

    I'm not entirely sure on what your aim is here, so I've giving two answers. hopefully one is correct.

    Hide the row in midnight blue when Textbox255's expression value = 0
    Select the Midnight Blue row in Tablix 5 (click inside the tablix, and then click the box that appears to the left of the row). Right click the same box and click "row visibility". Select the Radio Option "Show or Hide based on an expression". and click the fx button. Enter your expression to change the visibility. If I have understood correctly, this would be:
    =IIF(Sum(IIf(Fields!ZrodloDanych.Value = "AC" And Fields!Typ.Value = "Fee", CDec(Fields!KwotaSAPCurrPer.Value), CDec(0))) = 0, TRUE, FALSE)
    TRUE denotes that the row is hidden, false means visibile. Click ok.

    Hide the Group Rodzaj, if the when the value of the expression in Textbox 244 = 0
     Select Tablix 5, and then at the bottom your have a pane for Row Group and Column Group. You have a Row Group named "Rodzaj". Right click that group and select Group Properties.

    Select the Filter pane, and click the Add Button. Enter your expression for your fees by clicking the xffx button, and select the data type it would return in the drop down box.
    =Sum(IIf(Fields!ZrodloDanych.Value = "AC" And Fields!Typ.Value = "Fee", CDec(Fields!KwotaSAPCurrPer.Value), CDec(0)))
    Finally enter the Operator as "<>" and the value as 0. This will filter out groups where the result of the above expression results in 0
    by clicking the button, and select the data type it would return in the drop down box. Finally enter the Operator as "<>" and the value as 0. This will filter out groups where the result of the above expression results in 0

    I hope one of those answers is correct, or leads you on the right path. If not, please do elaborate a bit more. Giving names of the textboxes would be helpful. You refer to fees, but the column fee only has Stated values (Base, Rate, Fee), and the Row Fee has many expressions, so I was a little confused.

    Many thanks.

    Thom~

    Excuse my typos and sometimes awful grammar. My fingers work faster than my brain does.
    Larnu.uk

  • Many thanks to You Thom A!!!
    You went thru my bad english and bad problem explanantion and it haven't dissuade you 🙂
    But Unfotunatelly the problem remains and here is way:
    Answer 1: this will hide only one row (MidnightBlue) and i want to hide whole group.
    Answer 2: acctually i have tried to achieve my goal using the same method as you mentioned. This code does more than i want 🙂 In a group we have two Fees, one on a MidnightBlue background and the other one on a White background. If your expression for any of these two rows returns a 0 then it hides whole group. So we can end up with situation when expression for row fee on a MidnightBlue background are not equal to 0 and are still hidden.
    I am working on it and when i find the answer i will post it.
    One more time THANK YOU A LOT FOR YOUR TIME Thom A!!!!

  • If you have two expressions, maybe combine the two into a filter and a BOOLEAN result? In simple terms, effectively:
    =IIF(([SUM EXPRESSION 1] = 0) AND ([SUM Expression 2] = 0), FALSE, TRUE)
    Then set the value to TRUE in the filter.

    Thom~

    Excuse my typos and sometimes awful grammar. My fingers work faster than my brain does.
    Larnu.uk

  • I have following expression in a filter but it hides group if any of the fees is equal to 0

      = Iif(Fields!Rodzaj.Value = "Fee"
          AND
          (Round(Sum(Fields!KwotaSAPCurrPer.Value),2) Or Round(Sum(Fields!KwotaSAPCurrPer.Value),2) Is Nothing)
          AND
          (Round(Sum(Fields!KwotaSAPCurrYTD.Value),2) Or Round(Sum(Fields!KwotaSAPCurrYTD.Value),2) Is Nothing)
          AND
          (Round(Sum(Fields!KwotaSAPLastPer.Value),2) Or Round(Sum(Fields!KwotaSAPLastPer.Value),2) Is Nothing)
          AND
          (Round(Sum(Fields!KwotaSAPLastYTD.Value),2) Or Round(Sum(Fields!KwotaSAPLastYTD.Value),2) Is Nothing)
          AND
          (Round(Sum(Fields!Roznica.Value),2) Or Round(Sum(Fields!Roznica.Value),2) Is Nothing)
          AND
          (Round(Sum(Fields!RoznicaYTD.Value),2) Or Round(Sum(Fields!RoznicaYTD.Value),2) Is Nothing)
          ,True,False)

Viewing 9 posts - 1 through 8 (of 8 total)

You must be logged in to reply to this topic. Login to reply