Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

Announcements
Qlik® Product Spotlight: Discover what’s possible. Get more from our products.
See for yourself. Register today.
jleefjcapital
Contributor II

if statement to change field name

I'm using this IF statement to change the field name on condition of another field value.

If([seriesID] = 'SMS01000000000000001', [value]) as [Alabama]

So basically, I am looking to create another field called [Alabama] using data points from [value] when [seriesID] = 'SMS01000000000000001'.

This code does not work in its current form.

44 Replies

Re: if statement to change field name

Can you share screenshots of a table which include seriesID, value and Alabama?

jleefjcapital
Contributor II

Re: if statement to change field name

I'm providing a screenshot of Date, SeriesID, and Value.  I was not able to rename the Value field to Alabama. 

jleefjcapital
Contributor II

Re: if statement to change field name

jleefjcapital
Contributor II

Re: if statement to change field name

Re: if statement to change field name

You will need to create a table instead of individual filters. I want to see how they look in a single row.

jleefjcapital
Contributor II

Re: if statement to change field name

Here you go.  I think one issue is, the data are monthly, and the dates are showing up as daily so there are many nulls.

Re: if statement to change field name

So my question to you is.... If you now create this field called Alabama

If([seriesID] = 'SMS01000000000000001', [value]) as [Alabama]

If won't show value for these rows?

Capture.PNG

jleefjcapital
Contributor II

Re: if statement to change field name

Yes.  It creates a separate field, but there's no data associated with it. 

Re: if statement to change field name

Can you add the image of the fourth column added to your table? Also can you share the complete script where you are doing this?