Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Can we Change The Name of A Field Coming out of the Qlikview report while exporting it into excel

Hi,

This Question may sound totally noob ,But i am new to qlikview development and i have a question which i am trying to figure out if it does happen really? Lets say we have a column named "Person_ID" which is coming out of the report but while exporting into excel the users who use the excel version want to see the column as "PersonNumber" or something like that.I know in the script task while coding the LOAD statement we can alias it but other than that is there any way where we can have the same name coming out of the report but change it going into excel.I have heard it can be achieved somehow not sure how.

Can someone help me with this?

Thanks,

Sujith.

3 Replies
calvindk
Creator III
Creator III

The easiest I can think of is to change the label of the Person_ID in the report to PersonNumber.


If you really need it to show different in the one chart you are trying to export, then you can do it in a macro.

Some inspiration for a macro can be found here : http://community.qlik.com/thread/80672

Best wishes

Not applicable
Author

Hi Anders,

The link for that macros is basically taking the output of the file and exporting it into already existing excel,But my question over here is i want to change the name of the filed while exporting into excel and i dont see if that is going to help me.

Thanks,

Sujith

calvindk
Creator III
Creator III

as i said it was an inspiration for macro creation. If you are fluent in VBA it should be very easy to add in something to change the value of Person_ID to PersonNumber.

First have macro create excel output of entire table, and then have the macro run something like this once data is transferred to your new excel:

Sub ChgID()

    Dim WS              As Worksheet

    Dim Search          As String

    Dim Replacement     As String

   Dim MatchCase       As Boolean

  Search = "Person_ID"

    Replacement = "PersonNumber"

    For Each WS In Worksheets

        WS.Cells.Replace What:=Search, Replacement:=Replacement, _

        LookAt:=xlPart, MatchCase:=False

    Next

End Sub

Edit: I still think you should convince your users to accept PersonNumber as a label in the report.. It is the easiest and also most consistent solution.