Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Independent validation for trusted, AI-ready data integration. See why IDC named Qlik a Leader: Read the Excerpt!
cancel
Showing results for 
Search instead for 
Did you mean: 
fcecconi
Partner - Creator III
Partner - Creator III

Set Analysis in a variable

Hello

I have a variable created using the following count(Distinct {$<CD_Flag={1}, RecoveryType={'InPatient'}, Adjustment_Flag={0}, RecordType={'Billing'}, Billing_Type_Flag={1}>} DistinctPatient)


It works some time and some time is give the wrong value.  If I cut and paste the actual logic into the expression it returns the correct value all the time.


Any thoughts?


thanks

Frank

1 Solution

Accepted Solutions
fcecconi
Partner - Creator III
Partner - Creator III
Author

Sunny

We found the issue.  It appears that the function WeekDay($(vToday)) is not always evaluating.  We have replaced this with a variable the contains the same logic and now we are getting the correct results.


thanks for leading us in the right directions.

View solution in original post

6 Replies
sunny_talwar

Are you using this with or without the equal sign?

The Little Equals Sign

The Magic of Variables

fcecconi
Partner - Creator III
Partner - Creator III
Author

Sunny

the variable is defined in an excel spreadsheet and doesn't have the = sign.

and in the express I am using $(vTotalDays_Inpatient_Curr_Day_Billing)

sunny_talwar

One way to check would be to remove the label and see if you see the same expression for when you use the expression vs when you use variable. Variable is essentially used to replace the expression, so when used, variable is expanded into the expression which gives the final result. If it shows the same expression... then there is no way it could give different output.

fcecconi
Partner - Creator III
Partner - Creator III
Author

Sunny

It has something to do with my if statement.  I replaced the variables with the logic and got the same result.  if i just enter the variable or logic without the if, I get the right result.

if(WeekDay($(vToday)) <> 'Sun', $(vTotalDays_Inpatient_Curr_Day_Billing), $(vTotalDays_Inpatient_Rolling3_Billing))

sunny_talwar

What is vToday?

fcecconi
Partner - Creator III
Partner - Creator III
Author

Sunny

We found the issue.  It appears that the function WeekDay($(vToday)) is not always evaluating.  We have replaced this with a variable the contains the same logic and now we are getting the correct results.


thanks for leading us in the right directions.