Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
petermoyaert
Contributor III
Contributor III

Wrong expression

Anyone an idea what could be wrong in this formula ?

Count ({$<Mid(Magazijnplaats_Artikel,1,1)={'1'}>} %Key_Samniv)

Purpose is to count the number of orderlines (%Key_Samniv) for which articles are placed in room 1 (so for which Magazijnplaats_Artikel starts with number 1).

Peter

4 Replies
Colin-Albert

A Set expression is based on a field value not an expression.

You could create a new field for Room in your load script and then use that in your set expression rather than using an expression for the room.

In your load script  add  left(Magazijnplaats_Artikel,1) as Room

Then use this expression in your chart

    Count ({$<Room={'1'}>} %Key_Samniv)

lironbaram
Partner - Master III
Partner - Master III

TRY this

Count (if(Mid(Magazijnplaats_Artikel,1,1)='1', %Key_Samniv))

swuehl
MVP
MVP

Only field names, no expressions, allowed in set modifiers left from the equal sign.

Create a new field with only the left most character

Count ({$<NewField = {'1'}>} %Key_Samniv)

or try

Count ({$<Magazijnplaats_Artikel = {"=Mid(Magazijnplaats_Artikel,1,1)='1'"}>} %Key_Samniv)

jonathandienst
Partner - Champion III
Partner - Champion III

I think we are making heavy weather, and you just need:

     Count ({$<Magazijnplaats_Artikel={'1*'}>} %Key_Samniv)

ie count where Magazijnplaats_Artikel starts with 1.

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein