Quick one. I have multiple nested ifs statement, say about 20 statements. I do realise that I shouldn't have that many if statements, so really looking for a better way.
QlikView seems to recognise the first 10 or so statements and then doesn't recognise the other statements.
Is there a way to rewrite this or an alternative to get this to work?
Any help will be appreciated.
Solved! Go to Solution.
I never heard of this limitation. And after testing in an app, it does confirm otherwise. Please check the sample qvw. I tried till 12th level - and worked fine.
Pick works for 'n' number of conditions.
RowNo() as R
Take St. table with dimension as R
and expr as
What does your massive If statement do? Can you post it?
There are options,
You could use wildmatch() if you are pattern matching
Example of my situation cut down.
join (data) load Tick_no,wildmatch(Description,
'*filesystem is now*',
'Error(s) written to /var/adm/messages *',
'The Qlikview Server service terminated unexpectedly.*',
'Possible performance problem*',
'* has hung threads. Contact *' ) as Pattern_match resident data;
LOAD * INLINE [
Pattern_match, Pattern Description
1, filesystem full
2, Var/ADM messages
3, Qlikview service Terminated
4, Performance Alert
5, Java OOM
6, Webserver server down or hung
My application has 30+ lines in the table.
Thanks for all the responses so far.
I have included a sample of my if and pick match expressions that stop after the 10th or 11th option
if(Col1 ='Chart1', 'Chart1',
if(View ='Chart2', 'Chart2',
if(View ='Chart3', 'Chart3',
if(View ='Chart4', 'Chart4',
if(View ='Chart5', 'Chart5',
if(View ='Chart6', 'Chart6',
if(View ='Chart7', 'Chart7',
if(View ='Chart8', 'Chart8',
if(View ='Chart9', 'Chart9',
if(View ='Chart10', 'Chart10',
if(View ='Chart11', 'Chart11',
if(View ='Chart12', 'Chart12',
if(View ='Chart13', 'Chart13',
if(View ='Chart14', 'Chart14',
if(View ='Chart15', 'Chart15'
Pick(Match(View, 'Chart1','Chart2', 'Chart3', 'Chart4', 'Chart5', 'Chart6', 'Chart7', 'Chart8', 'Chart9', 'Chart10', 'Chart11', 'Chart12', 'Chart13', 'Chart14', 'Chart15', 'Chart16', 'Chart17') ,
'Chart1','Chart2', 'Chart3', 'Chart4', 'Chart5', 'Chart6', 'Chart7', 'Chart8', 'Chart9', 'Chart10', 'Chart11', 'Chart12', 'Chart13', 'Chart14', 'Chart15', 'Chart16', 'Chart17') as Test_Col1
Wow. Can you explain what you are trying to do? Is this function on a "Calculation Condition" to display a chart only when conditions are met.
There may be a better way.
Ignore the labels I used, they are just for illustration.
What I am trying to do is to create a list in my script that I can use as a dropdown list in my front end, so users can navigate from page to page in a neat and tidy way.
Works fine for the frist 10 or 11, but not after it