Qlik Community

QlikView Layout & Visualizations

Discussion Board for collaboration on QlikView Layout & Visualizations.

sushil353
Honored Contributor II

How to select all values from a field

Hi All,

i have a field DT_TYPE in which the following data is given

NDF

NDF-absolute

NDF-Test

NDF-Origin

NDR

in my dashboard i want to provide following option  under DT_TYPE

NDF

NDR

NDF & NDR

such that when NDF is selected only defect type related to NDF is shown and when NDR is selected only NDR related data is shown and when NDF & NDR is selected then all type of NDF and NDR should shown....

Please help me out to solve this problem

Thanks

Sushil kumar

9 Replies
sushil353
Honored Contributor II

How to select all values from a field

ANYONE PLEASE SHARE YOUR EXPERIENCE

gandalfgray
Valued Contributor

How to select all values from a field

Hi Sushil

In the load script where you load your original DT_TYPE,

create another one with just the NDF and NDR-values

Load

...

if(DT_TYPE='NDF' or DT_TYPE='NDR',DT_TYPE, null()) As DT_TYPE2

...

In your GUI

add a list box for DT_TYPE2

If the users select NDF or NDR from that list box they will see only defect type related to NDF resp NDR,

if they select both they will see defect types related to both NDF and NDR.

/gg

Not applicable

Re: How to select all values from a field

GG,

you'll need to adjust that code a little as currently it would only pick up 2 of the 5 from the DT_TYPE field and I think Sushil is wanitng the test,Original, Absolute to be part of the NDF selection.

Load

...

if(Left(DT_TYPE,3)='NDF' or Left(DT_TYPE,3)='NDR',Left(DT_TYPE,3), null()) As DT_TYPE2

...

that should work for you now Sushil if I am understanding what you are after correctly

thanks

Joe

edit: you don't actually need the left for the NDR one as that is the only one with that name but it's good to have in there incase you expand that to have test original etc in the future

double edit: actually if those are your only names in the field

Left(DT_TYPE,3) As DT_TYPE2

would give you the extact same result and cut down the code

sushil353
Honored Contributor II

How to select all values from a field

Hi GandalfGray,

Thanks for your reply..

according to your suggestion DT_TYPE2 will take only NDF , NDR what about NDF-absolute, NDF-Test.....

DT_TYPE2 should contain only three values NDF, NDR and NDF&NDR when user select NDF then data should be related to NDF and if it is NDR then data should be related to NDR only... and if User select NDF and NDR then data should be related to all type of NDF (i.e NDF+NDF-absolute+NDF-Test.....+NDR) and NDR

Thanks

sushil353
Honored Contributor II

How to select all values from a field

Hi Joe,,

You are very right...

What is this LEFT() function?.. how it is taking all kind of NDF's

Thanks

Not applicable

Re: How to select all values from a field

it's just a function to select a set number of characters from the left side of your field, so in this case just the first 3 which you are interested in, you then left your true statement too so that 'NDF - test' for example just becomes 'NDF' in your new field allowing you have all the NDF types under that one name in your new field

thanks

Joe

gandalfgray
Valued Contributor

How to select all values from a field

Hi Sushil

It was not clear to me from your original post.

Are the different DT_TYPE values you enumerated at your original post the only possible values, or are the other values as well?

/gg

sushil353
Honored Contributor II

How to select all values from a field

Thank you very much Joe,,,

It solved my 90% problem... but how would i include NDF&NDR option in DT_TYPE2 such that my field should look in dashboard as:

DEFECT TYPE

NDF

NDR

NDF&NDR

Not applicable

Re: How to select all values from a field

Should be able to concat that into the same type

so load as normal

Defect_Type:

Load

DT_TYPE,

Left(DT_TYPE,3) As DT_TYPE2

then concat it

Concatenate(Defect_Type)

Load

DT_TYPE,

'NDF&NDR' As DT_TYPE2

should give you those 3 options in the DT_Type2 field

thanks

Joe

edit: can't give you the full script and i'm not sure on your table names and things but you should get the idea

Community Browser