Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Not applicable

How to add a new column using column name

i have a column name that includes the Phase and year (14Construction) and the data is $$$ value. How do i slit the phase which is construction and the year?

Example:

14Construction          15Designed

$$$                              $$$

$$                                   $

Tags (3)
4 Replies
MVP
MVP

Re: How to add a new column using column name

Hi

In your load script:

LOAD Left(YrPhase, 2) & 2000 As Year,

     Mid(YrPhase, 3, 50) As Phase,

     ...

Hope that helps

Jonathan

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein
Not applicable

Re: How to add a new column using column name

on top is what i have (and there are multiple column with different years and phases)  and on the bottom is what I'm trying to accomplish.

PhaseYearsTotals
Planning RO14$136,000
Planning AO1414,000
Design RO132,000
Design AO131,000
….14200,000
14
16
Planning RO15
Planning AO15
MVP
MVP

Re: How to add a new column using column name

I see the field names contain the year and phase information.

You might need a crosstable load to get this data into a more manageable fact style table. Check out crosstable loads in the manual. If you need more help on the crosstable, I suggest that you post some sample data here. The attach file option is available if you click on "Use advanced editor" on the reply window.

Jonathan

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein
Not applicable

Re: How to add a new column using column name

this is only good for excel for example and not when connecting directly to the database. i want to do a crosstable in the script that already pull if is possible. my source is not Table Files, is ODBC.

Community Browser