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

Announcements
Join us in NYC Sept 4th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
bwisealiahmad
Partner - Specialist
Partner - Specialist

Remove "0" from Empty Line

Hi,


I have a table that has some IF statements I am trying to remove because it loads quite slow sometimes. On lines that are emtpy a "0" comes up and I am trying to remove this. Right now the expressions is:

IF(

Report = Test

IF($(ReportName)_blankrow = 1, ' ', Sum(Expression))

Which produces something like this:

Skjermbilde2.PNG

Now if I remove the _blankrow check part it looks like this.

Skjermbilde1.PNG

Does anyone have a good suggestion for making it look like the first without using an IF statement in the front end?

Thanks,

Ali

23 Replies
sunny_talwar

Would you be able to share a sample or may be images of what you are seeing?

bwisealiahmad
Partner - Specialist
Partner - Specialist
Author

See attached

Skjermbilde3.PNG

sunny_talwar

It's strange that it worked here

Capture.PNG

I mean $(ReportName)_blankrow, but not in my expression... I see you used vRapport... what is the difference here?

Capture.PNG

bwisealiahmad
Partner - Specialist
Partner - Specialist
Author

I just used a different name for the variable because I translate the scripts usually to English.

Here is the original:

If(Report<>'Hours',

if($(Rapport)_blankrad=1 ,'', Sum({$<$(Rapport)_Traff = {1} >}[Resultat Belopp])/$(B_enhet) )
,
if(
$(Rapport)_blankrad=1 ,'', Sum({$<$(Rapport)_Traff = {1},_Valutaflagga={'0'} >}Quantity_Act) )
)

sunny_talwar

If the above is working, this should work too

If(Report<>'Hours',

     Pick(RangeSum($(Rapport)_blankrad, 1), Sum({$<$(Rapport)_Traff = {1} >}[Resultat Belopp])/$(B_enhet), ''),

     Pick(RangeSum($(Rapport)_blankrad, 1), Sum({$<$(Rapport)_Traff = {1},_Valutaflagga={'0'} >}Quantity_Act), ''))

bwisealiahmad
Partner - Specialist
Partner - Specialist
Author

That worked! Now just implement and test Thanks like always!

sunny_talwar

Awesome, but do you see any performance improvements?

bwisealiahmad
Partner - Specialist
Partner - Specialist
Author

Took out memory statistics before and will change all expressions in object and check afterwards. Can post results when I have changed all the expressions.

bwisealiahmad
Partner - Specialist
Partner - Specialist
Author

Changing between reports type is going faster now, but there is still performance issue when changing year month etc. There is al link table where YearMonthAccountNr is a key in the general ledger and in the link table and from there Date is linked to the Calendar Table.

Not very intuitive Think it is causing it to perform worse.

sunny_talwar

May be get rid of the first if statement also....

Pick(RangeSum($(Rapport)_blankrad, 1), RangeSum(

Sum({$<$(Rapport)_Traff = {1}, Report -= {'Hours'}>}[Resultat Belopp])/$(B_enhet),

Sum({$<$(Rapport)_Traff = {1},_Valutaflagga={'0'}, Report *= {'Hours'}>}Quantity_Act)), '')