Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
jleefjcapital
Creator II
Creator 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
sunny_talwar

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

jleefjcapital
Creator II
Creator II
Author

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

jleefjcapital
Creator II
Creator II
Author

jleefjcapital
Creator II
Creator II
Author

sunny_talwar

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

jleefjcapital
Creator II
Creator II
Author

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.

sunny_talwar

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
Creator II
Creator II
Author

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

sunny_talwar

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?