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

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
ajac
Contributor
Contributor

Rename dynamicially created table fields

Hi all,
not sure if this is possible but here goes... I'm reading in an Excel sheet that is formatted like this …
i.e. 3 areas with daily check and result which gets updated with 3 new rows every day and Loaded into QV daily.

AreaDateResult
A12021-01-011
A22021-01-013
A32021-01-016
A12021-01-023
A22021-01-027
A32021-01-029
A12021-01-036
A22021-01-035
A32021-01-031
.........


Requirement to create chart that shows Area as dimension and expressions with the value of each reading for the previous 3 days 

I've created a Generic Load which reformats the table like this for the 3 days … so each day the table is recreated
where by the oldest date drops off and the current date is added as fieldname.

Area2021-01-012021-01-022021-01-03
A1136
A2375
A3691

 

As the field names change every day, is there a way to rename the fields Day1  Day2 Day3, or refer to them by index or something, to be  so that these can be used as expressions in a chart?

Labels (1)
2 Replies
marcus_sommer

I wouldn't do this generic load else using a pivot-table within the UI to display your wanted view. The replacement of the changeable date-values could be done within the master-calendar, maybe with something like this:

'Day ' & today() - datefield as DayFromToday

- Marcus

ajac
Contributor
Contributor
Author

Thanks Marcus, definitely gave me a different option to think about.
Taking your suggestion into consideration I used a variable to calculate the Today ... Today-1 Today-2 and then used that as criteria on Loads,   concatenating the result tables to give the Days as expressions with fixed headings to use in my chart.