Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
maxsheva
Creator II
Creator II

text or numerical using in conditions

Hi Qlik Community,

Would you please advise whether is difference on performance what using in conditions text or numerical?

I might be great if updated documentation somewhere is.

This below is just an example but let's suppose millions of rows.


data:

LOAD * Inline [

field_code, field_name, value

1, name, 100

];

sum({<field_code={'1'}>} value)

sum({<field_name={'name'}>} value)

10 Replies
sunny_talwar

Few people who might have an idea or two about this would be

pcammaert

rwunderlich

hic

troyansky

Anil_Babu_Samineni

As per rules from my architect and Data scientist notified Numeric is bit efficient rather than String which called "String storing considering Byte with each character where number is only one byte". this is what i got comment from them

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
Colin-Albert

Hi Max,

This post should give some insights...

String Key vs Integer Key -- any difference in link performance?

Peter_Cammaert
Partner - Champion III
Partner - Champion III

Aside from delivering a more compact data model, I seem to remember Stephen Redmond mentioning somewhere that sequential integers may do away with the symbol table altogether. I've never experienced that the document becomes much quicker, let alone when set analysis prepares a reduced data set.

maxsheva
Creator II
Creator II
Author

Thanks everyone for response.

rwunderlich
Partner Ambassador/MVP
Partner Ambassador/MVP

In my testing, there is no difference in String vs Numeric performance in a set analysis modifier. Both of these would perform the same:

sum({<field_code={1}>} value)

sum({<field_name={'name'}>} value)

In other contexts, such as an if(), numeric comparisons are significantly faster.

sum(if(ExpressShipNum=1, LineTotal))

is much faster than:

sum(if(ExpressShipText='Yes', LineTotal))

-Rob

http://masterssummit.com

http://qlikviewcookbook.com

maxsheva
Creator II
Creator II
Author

Thank you for experience sharing.

Oleg_Troyansky
Partner Ambassador/MVP
Partner Ambassador/MVP

I can repeat what Rob said - no difference in Set Analysis and a lot of difference when using IF() conditions.

Also, as others commented earlier - string fields would require more memory and storage size than numeric fields, so every time there is a choice what type of field to use, I'd prefer numeric fields - especially if the field has many distinct values. With just a few distinct values, the difference is negligible.

best,

Oleg Troyansky

rwunderlich
Partner Ambassador/MVP
Partner Ambassador/MVP

Peter,

It's correct that sequential integers do not use a symbol table. That can significantly reduce RAM requirements if there are many unique values for the field, typical with keys.

-Rob