Qlik Community

Qlik Sense App Development

Discussion board where members can learn more about Qlik Sense App Development and Usage.

Announcements
QlikWorld 2020: Join us May 11 - 14, 2020 in Phoenix, AZ. Register early and save $400. Learn More
Partner
Partner

Set analysis, less than or equal to, variable. Not calculating correctly.

Hi there

I have been given a QlikView model where there was a date input (vLoanBalanceDate) and this date was used in the following first measure below.

I am now on QlikSense recreating their model and want to calculate the same measure, using variables I have created, instead of the vLoanBalanceDate input.

I now have variables that contain the maximum dates I need to use in my set analysis. Could you please assist me with the set analysis script. I will attach a photo of the dates reflecting correctly in the new variables and also the statement I thought was right?

 

The original measure on the old QlikView model I was given:

sum(if ([Transaction Date]<= vLoanBalanceDate, if (Effect = 'Debit', [Transaction Amount], -[Transaction Amount]))

My new measure not working along with the new variables I need to use: (One to calculate the cumulative sum up to the max date on the selection and the other I want to show what the sum of tx's was a year ago)

Capture.PNG

 

The new script I have tried:

sum({$< [Transaction Date] = {'<=$(=vMaxTDate)'} > } if(Effect = 'Debit', [Transaction Amount], -[Transaction Amount]))

I am butting my head against the wall with this one. I have tried removing the = before vMaxTDate as well...

 

 

1 Solution

Accepted Solutions

Re: Set analysis, less than or equal to, variable. Not calculating correctly.

Try with double quotes

Sum({$<[Transaction Date] = {"<=$(=vMaxTDate)"}>} If(Effect = 'Debit', [Transaction Amount], -[Transaction Amount]))

Also, try this

Sum({$<[Transaction Date] = {"<=$(=$(vMaxTDate))"}>} If(Effect = 'Debit', [Transaction Amount], -[Transaction Amount]))

View solution in original post

2 Replies

Re: Set analysis, less than or equal to, variable. Not calculating correctly.

Try with double quotes

Sum({$<[Transaction Date] = {"<=$(=vMaxTDate)"}>} If(Effect = 'Debit', [Transaction Amount], -[Transaction Amount]))

Also, try this

Sum({$<[Transaction Date] = {"<=$(=$(vMaxTDate))"}>} If(Effect = 'Debit', [Transaction Amount], -[Transaction Amount]))

View solution in original post

Partner
Partner

Re: Set analysis, less than or equal to, variable. Not calculating correctly.

Try Using double quotes in your set. when using 'search' things in set analysis you should use ""
{$< [Transaction Date] = {"<=$(=vMaxTDate)"} > }