Skip to main content
Announcements
Qlik Introduces a New Era of Visualization! READ ALL ABOUT IT
cancel
Showing results for 
Search instead for 
Did you mean: 
datanibbler
Champion
Champion

Set_expression blocks regular user_selection in spite of $?

Hi,

I have a chart with the date as dimension and a COUNT(DISTINCT) as expression.

=> The tricky thing is, I need to display two values and a quota out of these two

   - One of those values is available every day (so it is there for today)

   - The other is available only up to yesterday

   => That would give me a quota of 100% for "today" which is false.

=> To avoid that, I have to block the display for "today"

=> To that end, I have a set_expression in my formula that looks something like this

     >>> {$<%Date < TODAY>} <<<

<=> That set_expression works fine - but, what I didn't realize until now just because I never tested it - is that it seems to block regular user_selections on that same date_field >> %Date << - when I select only one day on that field, the expression where I have that set_expression does not react, only the other one where I don't have it - which is again wrong 😉

Can somebody help me here?

Thanks a lot!

Best regards,

DataNibbler

10 Replies
tresesco
MVP
MVP

May be you can try like:

%Date={"<$(=TODAY())"}

datanibbler
Champion
Champion
Author

Hi Tresesco,

no, unfortunately that doesn't work.

I had that set_expression slightly bigger, but yours works just the same - in this case, though, the result is the same:

- The formula works and the value for "today" is not displayed.

<=> When I select CW 50 and then I select just Dec13 (Fri), still the whole week is displayed.

tresesco
MVP
MVP

Could please post a sample with expected output described?

swuehl
MVP
MVP

{$<%Date < TODAY>}

is not a valid set expression. You can't use a comparison operator like < in a field modifier.

Besides this, what is TODAY? A field? A variable?

datanibbler
Champion
Champion
Author

Hi,

that set_expression in my first post was just an example. As I said, the real one does work insofar as the value for "today" (a variable) is not displayed.

@ tresesco

I am trying to put together a sample - for some reason, now I get a value for every day of this week - there should be no values for the rest of the week, though...

datanibbler
Champion
Champion
Author

Hi,

I think now I've made it. I'll attach

- an Excel file with some fake personell_data

- a qvw to display the  presence_quota

As you see, sickness_data is not available for "today", only presence_data is available -> so I get a presence_quota of 100% for "today" which would be wrong

=>´To avoid that, I introduced that set_expression to display the values only up to "yesterday"

<=> That now seems to block any regular user_selections on that date_field.

datanibbler
Champion
Champion
Author


Hi,

seems I've made it.

Reading up on "set operators", I realized what I should be using: The "-=" operator.

I ended up with this formula (irritatingly, it is nearly all underlined in the editor, but it says "Expression ok", and it seems to be working:

>>> COUNT({$<%Datum -= {'16.12.2013'}>} DISTINCT Pers_Nr5) <<<

I only now have to dynamize today's date. But the effect is what I wished for: The user can select any one day from the week before - but the value is not displayed for today.

Best regards,

DataNibbler

swuehl
MVP
MVP

Have you already tried using a dollar sign expansion similar to what tresesco suggested above?

COUNT({$<%Datum -= {'$(=today())'}>} DISTINCT Pers_Nr5)

datanibbler
Champion
Champion
Author

Hi swuehl,

yes, I have.

It seems to be working now.

Thank you all!

Best regards,

DataNibbler