Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Qlik Sense August 2021 (Patch 1)
I have created a VARIABLE in Qlik Sense calculating a simple ratio between two subsets. In Nprinting I want to use that VARIABLE in a CONDITION to only publish a report if the ratio is below 98% (0,98). The reports are all filtered with values. None is in the calculation for the VARIABLE.
VARIABLE:
1-(Count({$<
Error={'Value'},
[Date.autoCalendar.MonthsAgo]={">0<2"}
>}[CaseNo])
/
Count({$<
[Date.autoCalendar.MonthsAgo]={">0<2"}
>}[CaseNo]))
I then create a CONDITION in Nprinting saying that if VARIABLE is LESS THAN CONSTANT. Setting this CONDITION on reports as TRUE for publishing.
I have tried the following CONSTANT values:
0,98 - Lets everything thru
0.98 - Stops everything (wrong format I am guessing)
98% - Lets everything thru
Do I need to put a ='0,98' or something else in the CONSTANT? Or is there something else faulty with this?
Hi, you tried that already as well but I still will touch on that topic...
I see that you are writing comma (,) as decimal point. It is possible that in Qlik Sense and in NPrinting you are using dot (.) as decimal point. That would mean that you are comparing number to text since they could be different values because of character used.
I often suggest to multiply your expression variable by 100 so then you dont need to use any characters which could cause issue. If I was writing your expression i would do following:
=Floor(100*(1-(Count({$<
Error={'Value'},
[Date.autoCalendar.MonthsAgo]={">0<2"}
>}[CaseNo])
/
Count({$<
[Date.autoCalendar.MonthsAgo]={">0<2"}
>}[CaseNo]))))
Then in NPrinting you can just compare it to integer values like 95 or 98 or whatever....
Have you tried that?
Does your variable expand? Do you have = sign in front of your expression in variable definition?
this is explained here:
Hi Lech,
I did NOT have a "=" in front of the variable, so that might have been an issue. Now rectified thank you.
I still get the issue that even though I set the CONSTANT to 0,98 my two test reports, both get through the CONDITION although both request it to be TRUE that VARIABLE is LESS THAN 0,98.
REPORT VARIABLE VALUE
-------------------------------------------------------------
report1 0,98189354275742
report2 0,95216049382716
Hi, you tried that already as well but I still will touch on that topic...
I see that you are writing comma (,) as decimal point. It is possible that in Qlik Sense and in NPrinting you are using dot (.) as decimal point. That would mean that you are comparing number to text since they could be different values because of character used.
I often suggest to multiply your expression variable by 100 so then you dont need to use any characters which could cause issue. If I was writing your expression i would do following:
=Floor(100*(1-(Count({$<
Error={'Value'},
[Date.autoCalendar.MonthsAgo]={">0<2"}
>}[CaseNo])
/
Count({$<
[Date.autoCalendar.MonthsAgo]={">0<2"}
>}[CaseNo]))))
Then in NPrinting you can just compare it to integer values like 95 or 98 or whatever....
Have you tried that?
Thank you Lech,
Seems like (,) or (.) are both no good ideas when handling variables in conditions. But using none decimal values seems to do the trick.
Brgds
Sebastian