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

Announcements
Qlik Connect 2026! Turn data into bold moves, April 13 -15: Learn More!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Why does this expression work in one instance and not the other?

I am rather new to Qlikview and have figured out a number of techniques along the road, but I have been struggling with what I thought was a rather simple expression for two days now, and I am hoping someone can help me understand why this is not working.

A little background:

I have a document with approximately 150 fields (some of which are not well-named for the end users.  To help manage the field labels, I created an Excel file with all 150 field names, and a corresponding Field-Alias that I load as part of the script ... the field aliases are then used on my listboxes and chart columns using the following syntax:

=Only({<MapThisField={$(=GetCurrentField(cycl_DigitalAnalysis0))}>} FldAlias_B)

...on this one I have a cyclic field that has 8 items in it .... 7 of them are other fields and 1 is an expression.  And I get the field alias as expected for the 7 real fields, but my struggle surrounds the expression.

The expression starts with the term "=if(" so I thought I could test like this to handle that exception:

=if(GetCurrentField(cycl_DigitalAnalysis0) LIKE '*=if(*', 'Site/Product', '~OTHER~')

...and it works Great.

So why can't I get this to work?

=if(GetCurrentField(cycl_DigitalAnalysis0) LIKE '*=if(*', 'Site/Product', Only({<MapThisField={$(=GetCurrentField(cycl_DigitalAnalysis0))}>} FldAlias_B) )

I have tried various ways of testing for NULL and nothing I do seems to provide me with a solution.  Even in the latter expression, it works just fine for the 7 real fields, but I continue to get "-" for that 8th field/expression.

Why?  Can anyone help me understand this?  If samples 1 and 2 above work fine, why wouldn't #3?

Right now I do not have a trimmed-down example document I could share, but if it becomes necessary, I can mock something up and post it.  Hopefully someone can spot my short-sightedness in the above posted expressions.

Any help would be greatly appreciated.

UPDATE TO ORIGINAL POST - 12/20/2013 @ 2:19pm EST

I have now added a sample document to help illustrate the issue.

* Although I do trust Henric's alternative suggestion, this will still bother me until I can at least understand WHY.  The syntax seems to work correctly in one instance, but not the other.

10 Replies
qlikpahadi07
Specialist
Specialist

Thanks For Sharing Chris

Merry Christmas!!!!