Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
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)
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
Hi Max,
This post should give some insights...
String Key vs Integer Key -- any difference in link performance?
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.
Thanks everyone for response.
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
Thank you for experience sharing.
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
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