Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
elstanford0430
Partner - Contributor III
Partner - Contributor III

Need an "if" expression

I am trying to write an expression based on the selection of another expression.

My report allows the end users to select actual revenue or expected revenue on a financial report.  I need the resulting Net Income calculation to populate correctly based on the revenue field that is selected.  Is this possible?  If the user has to select the correct Net Income to match the revenue field they selected, that may be messy if they do not do that correctly.

 

Thanks in advance.

ELS

1 Solution

Accepted Solutions
elstanford0430
Partner - Contributor III
Partner - Contributor III
Author

Thank you!  I had to adjust the formula for the full Adj Charges field name and it is working!

View solution in original post

9 Replies
chrismarlow
Specialist II
Specialist II

Hi,

What are you using to select the field? Are your different Net Income calculations different columns in your data or different sets of rows?

Cheers,

Chris.

elstanford0430
Partner - Contributor III
Partner - Contributor III
Author

1 row for each patient.  The charges (revenue) field contains a cyclic option to allow the user to select actual or expected.  I can only create a net income based on one or the other unless I can link it to their selection.  Does this help?

chrismarlow
Specialist II
Specialist II

Hi,

I think you should be able to use If(GetCurrentField([Your Group Name])='xxx', …) to toggle, something like the screenshots below.

Cheers,

Chris.

20190624_4.png20190624_3.png

elstanford0430
Partner - Contributor III
Partner - Contributor III
Author

thank you but will this work if I have only one field with the actual and expected charges and one field with actual and expected net income (using a cyclic group for both)?

How would I write the formulas or would I use your information below and create two formulas for NI? I am new at this.

chrismarlow
Specialist II
Specialist II

Hi,

Can you share the 4 formulae - i.e. actual and expected for charges and income? I am struggling to visualise what your data looks like … assume something about the rows included for a field gives actual & expected ...

Cheers,

Chris.

elstanford0430
Partner - Contributor III
Partner - Contributor III
Author

I provided an attachment that may better show the issue.

elstanford0430
Partner - Contributor III
Partner - Contributor III
Author

Gross Charges = sum([Actual Charges])

Adj Gross Charges = sum([Actual Charges])-sum([Non-Covered Charges])

chrismarlow
Specialist II
Specialist II

Hi,

With a large nod to Cyclic-expression-GetCurrentField I think the following will work for you;

[Net Income]/if(len([Gross Charges]),[Gross Charges],[Adj Gross Charges])

Ignore the bad field name error, it seems to work itself out. Other option I think is to use Column() - but above I think is easier to follow.

Cheers,

Chris.

elstanford0430
Partner - Contributor III
Partner - Contributor III
Author

Thank you!  I had to adjust the formula for the full Adj Charges field name and it is working!