Skip to main content
Announcements
See what Drew Clarke has to say about the Qlik Talend Cloud launch! READ THE BLOG
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Last value as default

CharityAmount Collected by Employees
Mend Our Mum£58.12
British Heart Foundation£82.39
St. Luke's Hospice

I would like a text box which states:

Last donation was to 'British Heart Foundation' with a total amount of '£82.39'

However, when there is a value entered in the spreadsheet  for St. Luke's I would like to show that.

Therefore ALWAYS showing the last value found but the user still has the ability to make previous selection.

Thanks

1 Solution

Accepted Solutions
sunny_talwar

Use this script where I create a new Column RowNo() as S.No and use that in your text box:

Script:

Table:

LOAD RowNo() as S.No,

  Charity,

    [Amount Collected by Employees]

FROM

[https://community.qlik.com/thread/163806]

(html, codepage is 1252, embedded labels, table is @1);

Text Box Object's Expression:

='Last donation was to ' & Chr(39)& Only({<S.No = {"$(=Max({<[Amount Collected by Employees] = {'*?'}>} S.No))"}>} Charity) & Chr(39) & ' ' &

'with a total amount of ' & Chr(39) & Only({<S.No = {"$(=Max({<[Amount Collected by Employees] = {'*?'}>} S.No))"}>} [Amount Collected by Employees]) & Chr(39)

Also find attached a sample application.

HTH

Best,

Sunny

View solution in original post

5 Replies
PrashantSangle

Hi,

Do you have any id field/ Date Field which gives you which one entered last ????

Look for FirstSortedValue() it might help you..

Regards

Great dreamer's dreams never fulfilled, they are always transcended.
Please appreciate our Qlik community members by giving Kudos for sharing their time for your query. If your query is answered, please mark the topic as resolved 🙂
datanibbler
Champion
Champion

Hi emma,

there are probably different ways to do this.

The probably easiest one (I can think of) though is to create a textbox that

- shows the last donation (by date, just use the max(date) function to find out about that)

- is visible only as long as the user has not made any selections
    (use the Getcurrentselections() or Getfieldselections([field]) function to find out about that)

HTH

sunny_talwar

Use this script where I create a new Column RowNo() as S.No and use that in your text box:

Script:

Table:

LOAD RowNo() as S.No,

  Charity,

    [Amount Collected by Employees]

FROM

[https://community.qlik.com/thread/163806]

(html, codepage is 1252, embedded labels, table is @1);

Text Box Object's Expression:

='Last donation was to ' & Chr(39)& Only({<S.No = {"$(=Max({<[Amount Collected by Employees] = {'*?'}>} S.No))"}>} Charity) & Chr(39) & ' ' &

'with a total amount of ' & Chr(39) & Only({<S.No = {"$(=Max({<[Amount Collected by Employees] = {'*?'}>} S.No))"}>} [Amount Collected by Employees]) & Chr(39)

Also find attached a sample application.

HTH

Best,

Sunny

Not applicable
Author

Worked perfectly Sunny - really appreciate your help


sunny_talwar

Awesome

I am glad it worked.

Best,

Sunny