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: 
qv_bazz_10
Creator
Creator

Show single value if repeated in listbox

Hi everyone,

i have a list box with repeated values (specifically dates in format "DD/MM/YYYY") and i would like to "aggregate" them and see only one record if the value is the same, is there any way to do it?

Here's what i have now:

QV_Listbox.JPG

Here's what i would like to see:

Giorno pubblicazione flusso

08/02/2016

07/02/2016

06/02/2016

...


Thank in advance,

Andrea

1 Solution

Accepted Solutions
18 Replies
sunny_talwar

I think you need to fix this in the script. Seems like your date field is actually timefield with time component in it.

Try this:

Date(Floor(DateField)) as DateField

and then create a list box for DateField.

qv_bazz_10
Creator
Creator
Author

Hi Sunny T,

what do you mean with "script"? Sorry, i'm a beginner with QV...i checked the configuration of the number format in the table box, this is what i see:

It's the same configuration i have in the list box. May you please tell me where do i have to insert your code?

Thanks again,

Andrea

jyothish8807
Master II
Master II

Hi Andrea,

There is definitely an issue with you date field format, other wise list box will show only one entry for each.

So as Sunny mentioned you can do that also, or try like this:

Load

date(date#(Giorno pubblicazione flusso,'DD/MM/YYYY'),'DD/MM/YYYY') as Giorno pubblicazione flusso

resident  <>


Regards

KC

Best Regards,
KC
qv_bazz_10
Creator
Creator
Author

Hi Jyothish,

sorry, i'd like to try your fix or the Sunny one but i'm a real newbie and i don't understand where do i have to insert the code...sorry again and thanks for your help.

Andrea

jagan
Luminary Alumni
Luminary Alumni

Hi,

Changing in script is the best option, open the script window and search for this date field and replace it with

LOAD

'

'

'

Date(Floor(DateField)) as DateField

'


Note: Replace DateField with your actual field name.


Regards,

jagan.

qv_bazz_10
Creator
Creator
Author

Sorry again...i'm afraid i need a step-by-step help...what do you mean with the script window? Do i have to locate it somewhere in the table box properties o anywhere else?

Thank you very much,

Andrea

jyothish8807
Master II
Master II

Hi Andrea,

You need to make changes in the backed script. Press Ctrl+E to go to script editor.

Over there is in load statement you need to make changes:

Load

date(date#(Giorno pubblicazione flusso,'DD/MM/YYYY'),'DD/MM/YYYY') as Giorno pubblicazione flusso

from <>

Regards

KC

Best Regards,
KC
sunny_talwar

Not that script. For going into the script you need to press Ctrl + E and then the 'Script Editor' will show up. Search for this -> Giorno pubblicazione flusso and whereever this is getting created, either change this or create a new field like this

LOAD [Giorno pubblicazione flusso],

          Date(Floor([Giorno pubblicazione flusso])) as Date

          YourOtherFieldsAsIs

FROM/Resident ...

Try the above and let us know if you still have trouble.

Best,

Sunny

qv_bazz_10
Creator
Creator
Author

Ok, i understood why i couldn't find the script editor: the function is disabled because i'm operating on a limited user version, i should have administrator's access to do it...do you think it's the only way to do it or maybe there's another one without having to edit the script?

Thanks again,

Andrea