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

Announcements
Want to see what's currently in public preview? We've pulled it all together in one place. Check it out here
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

If Expression

Hi,

I want to fill my Listbox only with fields that have field_type 'date'.

I used this expression, but it shows all values of the table. Although But I have different Field_types.

=if(Field_Type = 'Date'),$Field)

Br,

CM

Labels (1)
1 Solution

Accepted Solutions
sunny_talwar
MVP
MVP

May be this?

If(WildMatch(Lower(Field_Type), '*date*'), Field)

and for normal, may be this:

If(not WildMatch(Lower(Field_Type), '*date*'), $Field)

View solution in original post

9 Replies
Anil_Babu_Samineni
MVP
MVP

Try this

=if(match(Field_Type , 'Date'),Field_Type)

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
Not applicable
Author

Hi Anil,

Thanks for the reply.

I want to generate the Fieldnames ($Field). But only when the field_type = 'Date'. It seems not to work for me?

Thanks,

Mathias

sunny_talwar
MVP
MVP

Field_Type is a field that comes from the data? May be you need this:

If(WildMatch(Lower($Field), '*date*'), $Field)

Not applicable
Author

Hi Sunny,

Field_Type indeed comes from the data. Every Field, has also a Field_Type. Depending on the Field_type (the ones which = 'date'), I want to see the $Field.

Is my question clear?

Br,

sunny_talwar
MVP
MVP

May be this?

If(WildMatch(Lower(Field_Type), '*date*'), $Field)

Not applicable
Author

This is the table I have:

 

FieldFieldType
NameNormal
AddressNormal
StartDateDate

I want only the field in the listbox when Fieldtype = 'Date'.

Purpose is to have another listbox with the other fields when FieldType is 'Normal'.

So I want to split up the fields according field_type.

Br,

Mathias

sunny_talwar
MVP
MVP

May be this?

If(WildMatch(Lower(Field_Type), '*date*'), Field)

and for normal, may be this:

If(not WildMatch(Lower(Field_Type), '*date*'), $Field)

Not applicable
Author

Hey Sunny,

Thank you very much. It works now.

But can you explain me the difference between your first and second solution?

Best regards,

MC

sunny_talwar
MVP
MVP

You mean difference between these two expressions

If(WildMatch(Lower(Field_Type), '*date*'), Field)

and

If(WildMatch(Lower(Field_Type), '*date*'), $Field)

I guess you were using $Field before and I changed it to Field