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

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Fixed expression in text object

Hi everyone,

I could need some help with fixing an expression in a text object so that I can display a certain calculated value no matter what selections are made.

Here's the problem:

I have a text object with the following text and expression:

='Bankdaten ' & Count (Distinct( if( [SAP Tabelle]='LFBK - Lieferantenstamm (Bankverbindungen)',  Änderungsbelegnr )))

Now, I would like to fix this expression, so that the calculated value is shown even if another selection is made.

At the same time, this text box is only supposed to pop up when a certain button is pressed.

Therefore I already created a variable (vBankdatenGesamt), which is set to 1 by clicking the button.

So, I came up with an expression like:

=if(vBankdatenGesamt = '1', 'Bankdaten Gesamt ' & Count ( Distinct( if( [SAP Tabelle]={'LFBK - Lieferantenstamm (Bankverbindungen)', Änderungsbelegnr))))

But I still need to fix this one.

Any help is appreciated!

Kind regards,

Daniela

15 Replies
Jason_Michaelides
Partner - Master II
Partner - Master II

For your first question you can put anything you like in set analysis:

=Count ({< [SAP Tabelle]={'LFBK - Lieferantenstamm (Bankverbindungen)'}, [CPD-Kreditoren]={'ja'}>} DISTINCT Änderungsbelegnr)

This will simply return 0 if that's the answer.

I don't really understand your second question, but I think maybe look at the functions GetPossibleValues() and GetSelectedValues()

Hope this helps,

Jason

MarcoWedel

Hallo Daniela,

another solution to only let your text box expression respond to month or year selections might be:

='Bankdaten Gesamt:'&Count({1<[SAP Tabelle]={'LFBK'},Geschäftsjahr=$::Geschäftsjahr,Monat=$::Monat>} DISTINCT Änderungsbelegnr)

QlikCommunity_Thread_231689_Pic2.JPG

QlikCommunity_Thread_231689_Pic1.JPG

QlikCommunity_Thread_231689_Pic3.JPG

QlikCommunity_Thread_231689_Pic4.JPG

vielleicht hilft's

Gruß

Marco

Not applicable
Author

Thanks a lot! I got it!

I created two new variables (vCPD and vKredexCPD) and integrated them and your above expression into the text field of my text object:

=if(vCPD= '1', 'CPD-Kreditoren ' & Count ({< [SAP Tabelle]={'LFBK - Lieferantenstamm (Bankverbindungen)'}, [CPD-Kreditoren]={'ja'}>} DISTINCT Änderungsbelegnr),
if(vKredexCPD = '1', 'Kreditoren ex CPD ' & Count ({< [SAP Tabelle]={'LFBK - Lieferantenstamm (Bankverbindungen)'}, [CPD-Kreditoren]={'nein'}>} DISTINCT Änderungsbelegnr),
'Bankdaten ' &
Count (Distinct( if( [SAP Tabelle]='LFBK - Lieferantenstamm (Bankverbindungen)',  Änderungsbelegnr )))))

The variables are set to 1 by pressing the corresponding buttons. This way I managed to display the correct values in my text object with the corresponding titles. And using the same variables I also got my graphic to display "no data" when applicable.

So, both questions answered.

Regards,

Daniela

Not applicable
Author

Thanks, Marco.

Already integrated the other solution into my qvd-file, but it seems your answer would have done the same job.

Regards,

Daniela

Not applicable
Author

Hey Jason,

I could need another advice for fixing an expression.

This time I got a text box which is supposed to give me a certain text depending on which year I select.

The below screenshots display the required text to be shown for 2016 and 2013 respectively.

   

The text itself has some variable factors which keep changing whenever I select a value in any other field.

Currently, when I drill down to certain items of a year, the text keeps changing accordingly. This is what I need to avoid. Especially, the selection in the field "BelegNr." is not allowed to influence the numbers in my text box..

This is my expression:

=Geschäftsjahr & if(Match(Geschäftsjahr,'2013', '2016'), ': ', ' ')
&
if( Geschäftsjahr = '2016', Count({1< Geschäftsjahr = {'2016'} >} Distinct BelegNr.) & if(Count({< Geschäftsjahr = {'2016'} >} Distinct BelegNr.)=1, ' Änderung', ' Änderungen')
//& if(Num ([Alter Wert BELEG]) <= Num([Neuer Wert BELEG]),
& if(Count({1< Geschäftsjahr = {'2016'} >} Distinct BelegNr.)>1, '
' &
GetPossibleCount(BelegNr.), ' ') & ' von ' & Count({1< Geschäftsjahr = {'2016'} >} Distinct BelegNr.) & ' Änderungen '
&
if(Count(Distinct BelegNr.)=1, 'ist', 'sind') & ' nicht ordnungsgemäß. Das Basisdatum wurde von ' & if(Count(Distinct Änderer)=1, 'User ' & Änderer, Count(Distinct Änderer)& ' Usern') & ' in die Zukunft gelegt.' ,
if(Geschäftsjahr = '2013', Count({< Geschäftsjahr = {'2013'} >} Distinct BelegNr.) & if(Count({< Geschäftsjahr = {'2013'} >} Distinct BelegNr.)=1, ' Änderung', ' Änderungen')
&
if(Num ([Alter Wert BELEG]) >= Num([Neuer Wert BELEG]), '
Keine Beanstandungen.')) & ' ')

I also attached a sample of my qvd.

Hope you can help me on this one.

A second aspect I would need to solve is that currently all items are counted. However, I would need to have the condition integrated that only items are counted for which [Alter Wert] <= [Neuer Wert] is true, without having those items explicitely selected.

Right now I worked my way around, but the moment more changes are recorded, this might not work anymore.

Example: another items date is changed and this time [Alter Wert] >= [Neuer Wert]. This would be an item not to be counted - leading to the text:

"2016: 7 Änderungen

6 von 7 Änderungen sind nicht ordnungsgemäß. Das Basisdatum ...."

Thanks in advance. Regards,

Daniela

MarcoWedel

Hi,

please don't post independent questions in one thread, instead open a new one for your new question.

thanks

regards

Marco